AtCoder: Python: Daddy the sample test.

It is easy to copy and paste the test case input to INPUT by writing as follows. You can also measure the execution time.

test.py


import io
import sys
import time
_INPUT = """\
#Copy and paste the input here
"""
StartTime = time.time()
sys.stdin = io.StringIO(_INPUT)
# --------------------------------------------------------
#Describe the process here
# --------------------------------------------------------
print ("[Sec]"+str(time.time() - StartTime))

Example:

example_ABC177_A.py


import io
import sys
import time
_INPUT = """\
1000 15 80
"""
StartTime = time.time()
sys.stdin = io.StringIO(_INPUT)
# --------------------------------------------------------
d,t,s=map(int, input().split())
 
if d<=s*t:print("Yes")
else:print("No")
# --------------------------------------------------------
print ("[Sec]"+str(time.time() - StartTime))

output

example_ABC177_A.py


Yes
[Sec]0.0009970664978027344

Submit only within the dotted line.

Recommended Posts

AtCoder: Python: Daddy the sample test.
atCoder 173 Python
[Python] Test sample using unittest2, mock
Created AtCoder test tool for Python
Write the test in a python docstring
python setup.py test the code using multiprocess
About the test
AtCoder ABC 174 Python
Python closure sample
AtCoder ABC187 Python
AtCoder ABC188 Python
Python Integrity Test
AtCoder ABC 175 Python
Aggregate test results using the QualityForward Python library
AtCoder: Python: Automate sample testing as much as possible.
[Python] Test the moon matagi of relative delta
Until you run the changefinder sample in python
[Mac] Run the RealSense D415 sample in Python
Use the Python framework "cocotb" to test Verilog.
The 3rd Algorithm Practical Test (PAST) Explanation (Python)
[Modint] Decoding the AtCoder Library ~ Implementation in Python ~
Daily AtCoder # 2 in Python
Primality test by Python
Primality test with Python
Daily AtCoder # 6 in Python
Find the maximum Python
Daily AtCoder # 18 in Python
Daily AtCoder # 53 in Python
Daily AtCoder # 33 in Python
Daily AtCoder # 24 in Python
Daily AtCoder # 37 in Python
Daily AtCoder # 8 in Python
Daily AtCoder # 42 in Python
Daily AtCoder # 21 in Python
Daily AtCoder # 17 in Python
Daily AtCoder # 38 in Python
Daily AtCoder # 54 in Python
Daily AtCoder # 11 in Python
Daily AtCoder # 15 in Python
Daily AtCoder # 47 in Python
Daily AtCoder # 13 in Python
Python basics 8 numpy test
Daily AtCoder # 45 in Python
Python test package memo
Daily AtCoder # 30 in Python
the zen of Python
Daily AtCoder # 40 in Python
Ajax + Python + PostgreSQL sample
Daily AtCoder # 10 in Python
Primality test with python
Daily AtCoder # 5 in Python
Daily AtCoder # 28 in Python
Daily AtCoder # 39 in Python
Automate AtCoder submission (Python)
Daily AtCoder # 20 in Python
Daily AtCoder # 19 in Python
Daily AtCoder # 52 in Python
Daily AtCoder # 3 in Python
Daily AtCoder # 14 in Python
Daily AtCoder # 50 in Python
Daily AtCoder # 26 in Python