Submission #1042305

#TimeUsernameProblemLanguageResultExecution timeMemory
1042305sofppUnscrambling a Messy Bug (IOI16_messy)C++14
Compilation error
0 ms0 KiB
vector<int> vs(n,0); string c; for(int i=0;i<n;i++){ c+='0'; } string result=c; for(int i=n;i>=0;i--){ c[i]='1'; add_element(c); } compile_set(); for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ string h=result; if(h[j]=='1'){ continue; } h[j]='1'; if(check_element(h)==true){ result[i]='1'; vs[i]=j; } } } return vs; }

Compilation message (stderr)

messy.cpp:1:1: error: 'vector' does not name a type
    1 | vector<int> vs(n,0);
      | ^~~~~~
messy.cpp:2:5: error: 'string' does not name a type
    2 |     string c;
      |     ^~~~~~
messy.cpp:3:5: error: expected unqualified-id before 'for'
    3 |     for(int i=0;i<n;i++){
      |     ^~~
messy.cpp:3:17: error: 'i' does not name a type
    3 |     for(int i=0;i<n;i++){
      |                 ^
messy.cpp:3:21: error: 'i' does not name a type
    3 |     for(int i=0;i<n;i++){
      |                     ^
messy.cpp:6:5: error: 'string' does not name a type
    6 |     string result=c;
      |     ^~~~~~
messy.cpp:7:5: error: expected unqualified-id before 'for'
    7 |     for(int i=n;i>=0;i--){
      |     ^~~
messy.cpp:7:17: error: 'i' does not name a type
    7 |     for(int i=n;i>=0;i--){
      |                 ^
messy.cpp:7:22: error: 'i' does not name a type
    7 |     for(int i=n;i>=0;i--){
      |                      ^
messy.cpp:12:18: error: expected constructor, destructor, or type conversion before ';' token
   12 |     compile_set();
      |                  ^
messy.cpp:13:5: error: expected unqualified-id before 'for'
   13 |     for(int i=0;i<n;i++){
      |     ^~~
messy.cpp:13:17: error: 'i' does not name a type
   13 |     for(int i=0;i<n;i++){
      |                 ^
messy.cpp:13:21: error: 'i' does not name a type
   13 |     for(int i=0;i<n;i++){
      |                     ^
messy.cpp:27:5: error: expected unqualified-id before 'return'
   27 |     return vs;
      |     ^~~~~~
messy.cpp:28:1: error: expected declaration before '}' token
   28 | }
      | ^