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 17, 2026 01:07M-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 17, 2026 01:08015,307,8604,007,0002,255,0002,117,632expected "51250160166353 ", got "diag count=1000000 bytes=4000000 min=1836 max=2147479668 even=499865 lt64k=24 lt1m=500 div3=333225 div5=200278 first=1695898382,1001467708,2119561313,734164169,25350593,14733955,1921405626,1322178217 high=125239,124572,...
2May 17, 2026 01:08014,958,9654,062,0002,263,0002,117,632expected "51205639798845 ", got "diag count=1000000 bytes=4000000 min=92 max=2147482369 even=499422 lt64k=29 lt1m=475 div3=332446 div5=200177 first=81957895,757214870,260630180,1656613721,919878147,178486346,2050092852,1122785177 high=124968,125375,125...
3May 17, 2026 01:08015,046,8274,061,0002,295,0002,117,632expected "51099322279185 ", got "diag count=1000000 bytes=4000000 min=62 max=2147481937 even=499957 lt64k=41 lt1m=465 div3=333486 div5=199449 first=1711212794,426464149,1188367648,958166237,20423038,1862198063,1277037507,1548160668 high=124762,125565,1...