Блог пользователя BuzzyBeez

Автор BuzzyBeez, история, 4 месяца назад, По-английски

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)

  • Проголосовать: нравится
  • +11
  • Проголосовать: не нравится

»
4 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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 месяца назад, # ^ |
      Проголосовать: нравится +10 Проголосовать: не нравится

    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 месяца назад, # |
  Проголосовать: нравится +23 Проголосовать: не нравится

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 месяца назад, # ^ |
      Проголосовать: нравится +13 Проголосовать: не нравится

    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 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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