Submission #717618

#TimeUsernameProblemLanguageResultExecution timeMemory
717618EntityPlanttMemory (IOI10_memory)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" #include <vector> void play() { std::vector <int> mem[25]; int i; for (i = 0; i < 50; i += 2) { char a = faceup(i), b = faceup(i + 1); mem[a - 'A'].push_back(i); mem[b - 'A'].push_back(i + 1); if (a == b) { mem[a - 'A'].clear(); } } for (i = 0; i < 25; i++) { if (mem[i]) { faceup(mem[i][0]); faceup(mem[i][1]); } } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:16:18: error: could not convert 'mem[i]' from 'std::vector<int>' to 'bool'
   16 |         if (mem[i]) {
      |             ~~~~~^
      |                  |
      |                  std::vector<int>