Submission #964959

#TimeUsernameProblemLanguageResultExecution timeMemory
964959marinalucaMemory (IOI10_memory)C++17
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" using namespace std; void play (){ int NMAX = 50; vector <int> v; for (int i = 0; i < 50; ++ i){ v[i] = faceup(i + 1); } for (int i = 0; i < NMAX; ++ i){ for (int j = i + 1; j < NMAX; ++ j){ if (v[i] == v[j]){ faceup(i + 1); faceup(j + 1); } } } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:8:5: error: 'vector' was not declared in this scope
    8 |     vector <int> v;
      |     ^~~~~~
memory.cpp:3:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
    2 | #include "memory.h"
  +++ |+#include <vector>
    3 | 
memory.cpp:8:13: error: expected primary-expression before 'int'
    8 |     vector <int> v;
      |             ^~~
memory.cpp:10:9: error: 'v' was not declared in this scope
   10 |         v[i] = faceup(i + 1);
      |         ^
memory.cpp:14:17: error: 'v' was not declared in this scope
   14 |             if (v[i] == v[j]){
      |                 ^