Submission #198827

#TimeUsernameProblemLanguageResultExecution timeMemory
198827Markomafko972Memory (IOI10_memory)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" void play() { vector<int> v[50]; for (int i = 1; i <= 50; i++) v[i].clear(); for (int i = 1; i <= 50; i+= 2) { char c1 = faceup(i); char c2 = faceup(i+1); if (c1 != c2) { v[c1-'A'+1].push_back(i); v[c2-'A'+1].push_back(i+1); } } for (int i = 1; i <= 50; i++) { if (v[i].size() == 2) { faceup(v[i][0]); faceup(v[i][1]); } } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:6:2: error: 'vector' was not declared in this scope
  vector<int> v[50];
  ^~~~~~
memory.cpp:6:9: error: expected primary-expression before 'int'
  vector<int> v[50];
         ^~~
memory.cpp:7:32: error: 'v' was not declared in this scope
  for (int i = 1; i <= 50; i++) v[i].clear();
                                ^
memory.cpp:12:4: error: 'v' was not declared in this scope
    v[c1-'A'+1].push_back(i);
    ^
memory.cpp:18:7: error: 'v' was not declared in this scope
   if (v[i].size() == 2) {
       ^