This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
python3:input [2018/08/15 10:48] jguerin Fixed botched link syntax. |
python3:input [2018/08/15 16:40] (current) kericson [Benchmarks] - moving from io_tests to input_tests |
||
---|---|---|---|
Line 35: | Line 35: | ||
>>> | >>> | ||
1.2 2.3 3.4 4.5 # x=[1.2, 2.3, 3.4, 4.5] | 1.2 2.3 3.4 4.5 # x=[1.2, 2.3, 3.4, 4.5] | ||
- | </ | ||
- | |||
- | ===== Output Basics ===== | ||
- | Output is handled with the '' | ||
- | |||
- | <code python> | ||
- | >>> | ||
- | </ | ||
- | |||
- | <code python> | ||
- | >>> | ||
- | </ | ||
- | |||
- | <code python> | ||
- | >>> | ||
- | </ | ||
- | |||
- | <code python> | ||
- | >>> | ||
- | </ | ||
- | |||
- | <code python> | ||
- | >>> | ||
- | >>> | ||
</ | </ | ||
Line 89: | Line 65: | ||
- | ==== Benchmarks ==== | + | ===== Benchmarks |
- | The following benchmarks demonstrate the increased likelihood of failure of '' | + | The following benchmarks demonstrate the increased likelihood of failure of '' |
+ | |||
+ | 10 character and 1000 character benchmarks were selected to be indicative of many contest problems, and otherwise should indicate performance under most other assumptions. | ||
- | 10 characters per line (//n//= number of lines): | + | ==== Small Lines ==== |
+ | 10 characters((Selected to be roughly on the order of many similar reads: numeric primitives, small strings, etc.)) | ||
| //n// | input() | sys.stdin.readline() | sys.stdin.readlines() | | | //n// | input() | sys.stdin.readline() | sys.stdin.readlines() | | ||
| 10< | | 10< | ||
Line 99: | Line 78: | ||
- | 1000 characters per line (//n//= number of lines): | + | ==== Large Lines ==== |
+ | 1000 characters((Selected to be roughly on the order of problems with large reads that may be encountered in a contest setting.)) | ||
| //n// | input() | sys.stdin.readline() | sys.stdin.readlines() | | | //n// | input() | sys.stdin.readline() | sys.stdin.readlines() | | ||
| 10< | | 10< |