Parse dateTime Andrey Tsvetkov

Compute the sum of 5,000,000 UTC Unix timestamps as fast as possible.

Input

One RFC 3339 datetime per line on STDIN:

2017-05-04T14:31:30-03:00
2046-06-23T11:51:56-06:00
2031-08-14T13:18:38+06:00
2048-04-14T05:55:06-09:00
1980-08-28T00:43:03+02:00

Output

Print the sum of all UTC Unix timestamps (int64) to STDOUT.

Constraints

  • Datetimes are in the range 1950-01-01T00:00:00 to 2050-12-31T23:59:59
Back to listOct 4, 2026 18:03Karthik ReddyKarthik ReddyError
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2026 18:03070,287,96658,825,0001,073,0002,113,536expected "3468460265723591 ", got "n 128957440 lines 5000000 bad 208512 plus 2291412 minus 2500076 Z 0 y 1949-2051 tzmax 12 nondig: 0 0 0 0 4791488 0 0 4791488 0 0 4791488 0 0 4791488 0 0 4791488 0 0 4791488 0 0 4791488 0 0 | 2023-06-17T14:42:56-04:00 "
2Oct 4, 2026 18:03070,212,62058,646,0001,079,0002,113,536expected "3471073565300801 ", got "n 128961315 lines 5000000 bad 207737 plus 2292632 minus 2499631 Z 0 y 1949-2051 tzmax 12 nondig: 0 0 0 0 4792263 0 0 4792263 0 0 4792263 0 0 4792263 0 0 4792263 0 0 4792263 0 0 4792263 0 0 | 1990-01-29T10:48:20+08:00 "
3Oct 4, 2026 18:03070,388,95358,899,0001,084,0002,113,536expected "3471119445293038 ", got "n 128956950 lines 5000000 bad 208610 plus 2290335 minus 2501055 Z 0 y 1949-2051 tzmax 12 nondig: 0 0 0 0 4791390 0 0 4791390 0 0 4791390 0 0 4791390 0 0 4791390 0 0 4791390 0 0 4791390 0 0 | 2011-04-02T00:11:42-06:00 "