RBurgundy's blog

By RBurgundy, history, 2 years ago, In English

Compiling the following code under both 64-bit C++ versions gives a compiler error, but no useful error message, just "Invocation failed [COMPILATION_ERROR] Can't compile file:".

This compiles and runs fine on my machine (I use a large stack size). Is it possible to get a more useful error message from Codeforces here? Also, where are the compilation flags documented? I found https://codeforces.net/blog/entry/79 from the FAQ but it seems quite out of date.

#include <bits/stdc++.h>

constexpr int32_t MAXN = 2e5 + 5;

int main() {

    std::array<std::vector<int32_t>, MAXN> a{};

    return 0;
}
  • Vote: I like it
  • +37
  • Vote: I do not like it

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
2 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Without the bracket pair after the array declaration, it compiles fine. But I do not know why. Could anyone point out why?

»
2 years ago, # |
  Vote: I like it +16 Vote: I do not like it

Maybe it is compilation time limit exceeded? Some versions of GCC compile some constant arrays in quadratic time, it is a quite old bug. It seems like it could have happened in your case.