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 listJul 2, 2021 07:05Yuriy LyfenkoYuriy LyfenkoScore: 116,903Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2021 07:05114,0371,080,551,068556,780,0001,999,0002,510,848
2Jul 2, 2021 07:06114,0521,079,050,592557,857,000999,0002,514,944
3Jul 2, 2021 07:06114,0941,083,076,350559,063,00002,506,752
4Jul 2, 2021 07:05114,2291,085,299,859558,725,000999,0002,510,848
5Jul 2, 2021 07:05114,4091,088,348,119558,607,0001,998,0002,514,944
6Jul 2, 2021 07:06114,6821,093,566,289559,942,0001,999,0002,371,584
7Jul 2, 2021 07:06115,1681,093,492,008563,322,0001,000,0002,510,848
8Jul 2, 2021 07:06115,2791,090,410,995563,869,000999,0002,506,752
9Jul 2, 2021 07:06115,4001,093,423,230564,460,000999,0002,510,848
10Jul 2, 2021 07:06115,4111,092,759,809563,514,0001,998,0002,510,848
11Jul 2, 2021 07:06115,6401,095,949,885564,638,0001,998,0002,510,848
12Jul 2, 2021 07:05115,6691,094,852,057565,779,000999,0002,523,136
13Jul 2, 2021 07:06115,8701,095,084,089567,765,00002,510,848
14Jul 2, 2021 07:06115,8931,096,934,844566,878,000999,0002,260,992
15Jul 2, 2021 07:06115,9801,095,570,001568,302,00002,510,848
16Jul 2, 2021 07:06116,1731,094,081,486569,248,00002,371,584
17Jul 2, 2021 07:06116,2251,101,539,763568,504,000999,0002,367,488
18Jul 2, 2021 07:05116,7781,098,637,032571,211,0001,000,0002,506,752
19Jul 2, 2021 07:05116,9031,103,055,907571,824,000999,0002,506,752
20Jul 2, 2021 07:06116,9091,100,926,596571,855,000999,0002,506,752
21Jul 2, 2021 07:05117,0421,099,397,646572,507,000999,0002,506,752
22Jul 2, 2021 07:05117,2611,099,930,072572,580,0001,998,0002,514,944
23Jul 2, 2021 07:05117,9041,102,114,297576,729,000999,0002,506,752
24Jul 2, 2021 07:06119,2111,104,332,344583,133,0001,000,0002,506,752
25Jul 2, 2021 07:06120,0551,121,220,609586,273,0001,997,0002,506,752
26Jul 2, 2021 07:06120,0591,112,943,559588,290,00002,506,752
27Jul 2, 2021 07:06120,1141,117,655,770586,560,0001,998,0002,506,752
28Jul 2, 2021 07:05129,3291,183,715,109633,714,25102,232,320
29Jul 2, 2021 07:05129,4691,203,706,590634,395,94802,228,224
30Jul 2, 2021 07:06130,0551,221,718,319637,268,97102,240,512
31Jul 2, 2021 07:06130,0781,197,027,107637,380,63102,228,224
32Jul 2, 2021 07:06130,8961,208,917,572641,389,48002,228,224
33Jul 2, 2021 07:05131,1801,196,115,908642,779,73902,236,416
34Jul 2, 2021 07:06132,0691,213,767,909647,139,85902,232,320
35Jul 2, 2021 07:06132,1551,222,150,246647,561,37402,224,128
36Jul 2, 2021 07:06132,6371,218,371,263649,920,21702,228,224