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 listNov 2, 2022 00:35Bernard TeoBernard TeoScore: 49,927Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 2, 2022 00:3549,830262,333,653244,167,00002,281,472
2Nov 2, 2022 00:3549,853269,698,586243,278,0001,001,0002,396,160
3Nov 2, 2022 00:3549,854273,672,733244,287,00002,281,472
4Nov 2, 2022 00:3549,882269,299,657243,420,0001,001,0002,400,256
5Nov 2, 2022 00:3549,883268,306,537242,433,0001,995,0002,396,160
6Nov 2, 2022 00:3549,884271,546,440243,430,0001,001,0002,404,352
7Nov 2, 2022 00:3549,912274,397,599242,571,0001,996,0002,281,472
8Nov 2, 2022 00:3549,912270,862,371242,574,0001,996,0002,281,472
9Nov 2, 2022 00:3549,914271,852,370244,580,00002,400,256
10Nov 2, 2022 00:3549,914272,751,441242,581,0001,996,0002,400,256
11Nov 2, 2022 00:3549,916272,038,711243,591,000998,0002,281,472
12Nov 2, 2022 00:3549,918268,618,869242,604,0001,996,0002,396,160
13Nov 2, 2022 00:3549,918267,362,663242,603,0001,996,0002,396,160
14Nov 2, 2022 00:3549,918269,392,258242,601,0001,996,0002,408,448
15Nov 2, 2022 00:3549,919270,056,930243,604,000998,0002,273,280
16Nov 2, 2022 00:3549,920277,577,026243,612,000998,0002,281,472
17Nov 2, 2022 00:3549,922270,775,750242,623,0001,996,0002,281,472
18Nov 2, 2022 00:3549,926268,005,566243,633,0001,002,0002,281,472
19Nov 2, 2022 00:3549,927266,540,670243,642,000998,0002,510,848
20Nov 2, 2022 00:3549,932270,506,270243,670,000998,0002,400,256
21Nov 2, 2022 00:3549,937267,658,076242,692,0001,997,0002,281,472
22Nov 2, 2022 00:3549,948271,134,747243,747,000998,0002,400,256
23Nov 2, 2022 00:3549,951269,051,520242,761,0001,998,0002,506,752
24Nov 2, 2022 00:3549,966270,418,123243,836,000999,0002,514,944
25Nov 2, 2022 00:3549,970273,609,777242,855,0001,998,0002,392,064
26Nov 2, 2022 00:3549,973266,323,328242,872,0001,998,0002,392,064
27Nov 2, 2022 00:3549,977268,027,175242,886,0001,999,0002,396,160
28Nov 2, 2022 00:3550,030304,635,855245,148,22702,269,184
29Nov 2, 2022 00:3550,038318,477,014245,186,32102,265,088
30Nov 2, 2022 00:3550,057309,095,916245,280,31402,273,280
31Nov 2, 2022 00:3550,066304,079,717245,321,87902,265,088
32Nov 2, 2022 00:3550,066305,185,349245,322,32702,265,088
33Nov 2, 2022 00:3550,071311,837,067245,349,12702,269,184
34Nov 2, 2022 00:3550,113303,220,980245,553,40802,273,280
35Nov 2, 2022 00:3550,162316,714,247245,793,89802,260,992
36Nov 2, 2022 00:3551,333343,644,846251,529,80002,252,800