Submission #201881

#TimeUsernameProblemLanguageResultExecution timeMemory
201881Leonardo_PaesMemory (IOI10_memory)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "grader.h" #include "memory.h" void play() { vector<int> p[26]; int i=1, j=50, a; while(i<j){ a = faceup(i); p[a].push_back(i); a = faceup(j); p[a].push_back(j); i++, j--; } for(int i=1; i<=26; i++){ faceup(p[i][0]); faceup(p[i][1]); } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:6:5: error: 'vector' was not declared in this scope
     vector<int> p[26];
     ^~~~~~
memory.cpp:6:5: note: suggested alternative:
In file included from /usr/include/c++/7/vector:64:0,
                 from /usr/include/c++/7/functional:61,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71,
                 from memory.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:216:11: note:   'std::vector'
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^~~~~~
memory.cpp:6:12: error: expected primary-expression before 'int'
     vector<int> p[26];
            ^~~
memory.cpp:10:9: error: 'p' was not declared in this scope
         p[a].push_back(i);
         ^
memory.cpp:16:16: error: 'p' was not declared in this scope
         faceup(p[i][0]); faceup(p[i][1]);
                ^