Format integers Sergey Svistunov

Compute a checksum over the decimal representations of binary integers as fast as possible.

Input: 250 000 000 uint32 values in little-endian binary on STDIN (4 bytes each).

Output: A uint64 checksum computed as:

CRC = sum of number_crc(n) for each n

where number_crc(n) converts n to its decimal string and sums ascii(digit) * position over each digit (0-indexed from the left).

Example: For n = 42, the decimal string is "42", so number_crc(42) = ascii('4') * 0 + ascii('2') * 1 = 52 * 0 + 50 * 1 = 50.

Back to listSep 22, 2022 12:24Bernard TeoBernard TeoScore: 71,465Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 22, 2022 12:2471,358380,132,646347,658,0001,998,0002,281,472
2Sep 22, 2022 12:2471,389372,773,478347,807,0001,998,0002,281,472
3Sep 22, 2022 12:2471,390372,898,245348,813,000999,0002,281,472
4Sep 22, 2022 12:2471,393373,005,434347,827,0001,999,0002,281,472
5Sep 22, 2022 12:2471,396375,860,851347,842,0001,999,0002,281,472
6Sep 22, 2022 12:2471,397373,459,104347,844,0001,999,0002,400,256
7Sep 22, 2022 12:2471,400376,567,738348,863,000999,0002,400,256
8Sep 22, 2022 12:2471,407374,694,484349,893,00002,510,848
9Sep 22, 2022 12:2471,411373,902,475348,914,000999,0002,510,848
10Sep 22, 2022 12:2471,413373,848,284348,923,000999,0002,404,352
11Sep 22, 2022 12:2471,416372,785,022347,941,0001,999,0002,404,352
12Sep 22, 2022 12:2471,417373,015,984348,942,000999,0002,281,472
13Sep 22, 2022 12:2471,421372,052,409348,963,000999,0002,273,280
14Sep 22, 2022 12:2471,429375,378,458349,002,0001,000,0002,281,472
15Sep 22, 2022 12:2471,431376,846,662348,011,0002,000,0002,281,472
16Sep 22, 2022 12:2471,434378,947,871348,027,0002,000,0002,281,472
17Sep 22, 2022 12:2471,438377,944,083349,047,0001,000,0002,404,352
18Sep 22, 2022 12:2471,439372,457,487348,050,0002,000,0002,281,472
19Sep 22, 2022 12:2471,465376,585,753350,178,00002,400,256
20Sep 22, 2022 12:2471,481376,755,632349,258,0001,000,0002,281,472
21Sep 22, 2022 12:2471,896379,636,391352,288,00002,281,472
22Sep 22, 2022 12:2473,174422,074,980358,553,79002,256,896
23Sep 22, 2022 12:2473,194432,820,264358,651,29702,260,992
24Sep 22, 2022 12:2473,205433,947,487358,703,24802,260,992
25Sep 22, 2022 12:2473,216426,742,309358,756,59302,265,088
26Sep 22, 2022 12:2473,228430,170,890358,815,84202,269,184
27Sep 22, 2022 12:2473,245437,056,687358,900,20302,273,280
28Sep 22, 2022 12:2473,247439,297,529358,908,21002,260,992
29Sep 22, 2022 12:2473,695389,763,737359,105,0002,000,0002,400,256
30Sep 22, 2022 12:2473,956391,357,841361,385,0001,001,0002,281,472
31Sep 22, 2022 12:2474,185389,203,909362,504,0001,001,0002,400,256
32Sep 22, 2022 12:2474,207391,413,186362,615,000998,0002,400,256
33Sep 22, 2022 12:2474,208388,902,077362,623,000998,0002,281,472
34Sep 22, 2022 12:2474,257390,300,056361,859,0001,999,0002,281,472
35Sep 22, 2022 12:2475,577429,949,067370,328,26802,256,896
36Sep 22, 2022 12:2475,590426,410,948370,389,46102,260,992