Bug using global anonymous struct in GNU C++11 and GNU C++14

Revision en5, by pimenta, 2017-03-02 04:00:41

Hi,

I've sent submission 25136808 using a global anonymous struct with some big arrays and methods inside. The submission got RTE case 7.

Next, I send submission 25137642 only removing the struct from around the arrays and the methods, and I got AC.

Then I thought "maybe the global arrays are not being initialized to zero when they are inside the struct". So I called memset(&st,0,sizeof st); and I got RTE case 7 again: 25137670.

What's the deal with structs in Codeforces? All these 3 codes work fine I'm my notebook in test case 7.

UPD: I've just submitted the same 3 codes again, now with GNU C++14. The behavior is the same for all 3 codes.

UPD2: Now I've just submitted 25138080, only giving a name to the struct from the first submission and it got AC. So the problem is with anonymous structs??

UPD3: Seems like anonymous structs are not supported in C++ 11, after some Internet research...

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English pimenta 2017-03-02 04:00:41 103
en4 English pimenta 2017-03-02 03:43:47 177
en3 English pimenta 2017-03-02 02:59:22 7 Tiny change: 'I've just tested the sa' -> 'I've just submitted the sa'
en2 English pimenta 2017-03-02 02:58:40 129
en1 English pimenta 2017-03-02 02:54:50 635 Initial revision (published)