I tried to implement linear sieve in problem 2004E - Not a Nim Problem : 276726470. It worked perfectly fine on my local machine.
However, that code recieved 'Compilation Error' and the following Checker comment:
Can't compile file:
Compiled file is too large [42653443 bytes], but maximal allowed size is 33554432 bytes [CompileRequest {id='program.cpp', description='', file='program.cpp', resources='', type='cpp.gcc13-64-winlibs-g++20'}].
Does anybody know what happened? Is it related to judges being overloaded ? (today there has been a rly long queue)
This is curious. Even a long queue judge machine shouldn't affect the binary output. Did you check the size of your local executable file?
(Though looking at your code, I don't think it has anything to bloat the bin that hard. Maybe another odd bug within the judge.)
Damn, I never thought the size of the executable file could lead to CE :/
I just checked and it was pretty close to the reported $$$42653443$$$ bytes (over $$$4 * 10^7$$$ bytes), but I couldn't figure out what led to that. In my code I only used an array of size $$$10^7$$$ and a vector containing primes $$$\leq 10^7$$$.
You wrote
int G[N + 8] = {0, 1};
in the code. This let the compiler output a file includingG[2]=0,G[3]=0,...,G[N+7]=0
which is too much. Just delete the initialization and addG[1]=1
in the main funtion.Wow thanks, the locally compiled executable file size is now only $$$152$$$ KB.
But I guess I'll have to wait a few hours to get a new verdict based on the current queue XD
Auto comment: topic has been updated by BuzzyBeez (previous revision, new revision, compare).