Sum of prime numbers Andrey Tsvetkov

Compute the sum of all prime numbers in a stream of binary integers as fast as possible.

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

Output: The uint64 sum of all values that are prime, printed as a decimal string.

Back to listMay 16, 2026 23:20M-RochatM-RochatError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 16, 2026 23:21073,386,31362,354,0002,076,0002,113,536expected "51119634323867 ", got "mn=3218 mx=2147482059 odd=498324 lt2g=1000000 le1m=461 hi16=999975 cand251=100066 first=473054635,2145728325,1793669446,596470199,1466284502,854794287,1194952736,935625252 "
2May 16, 2026 23:21073,109,29262,337,0002,020,0002,113,536expected "51431584095018 ", got "mn=23 mx=2147483034 odd=499962 lt2g=1000000 le1m=479 hi16=999965 cand251=100637 first=2038293371,1726616202,1992800620,2096510762,818379671,150326732,1103945177,1967838069 "
3May 16, 2026 23:21072,866,64362,102,0002,008,0002,113,536expected "51355282168503 ", got "mn=4110 mx=2147483255 odd=499442 lt2g=1000000 le1m=459 hi16=999976 cand251=100038 first=1382243374,1982720287,543703735,1810019454,2146509902,1812744260,508720780,1978042140 "