BuzzyBeez's blog

By BuzzyBeez, history, 4 months ago, In English

I tried to implement linear sieve in problem 2004E - Это не задача про ним : 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)

  • Vote: I like it
  • +11
  • Vote: I do not like it

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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.)

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    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$$$.

»
4 months ago, # |
  Vote: I like it +23 Vote: I do not like it

You wrote int G[N + 8] = {0, 1}; in the code. This let the compiler output a file including G[2]=0,G[3]=0,...,G[N+7]=0 which is too much. Just delete the initialization and add G[1]=1 in the main funtion.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +13 Vote: I do not like it

    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

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by BuzzyBeez (previous revision, new revision, compare).