제출 #717673

#제출 시각아이디문제언어결과실행 시간메모리
717673nikosMemory (IOI10_memory)C++17
컴파일 에러
0 ms0 KiB
#include "grader.h" #include "memory.h" void play() { char a, b; vector< pair<int, int> > v; for(int i = 0; i < 25; i++){ v.pb(make_pair(0, 0)); } for(int i = 1; i < 50; i += 2){ a = faceup(i); b = faceup(i + 1); if(v[a - 'A'].first != 0){ v[a - 'A'].first = i; } else{ v[a - 'A'].second = i; } if(v[b - 'A'].first != 0){ v[b - 'A'].first = i; } else{ v[b - 'A'].second = i; } } for(int i = 0; i < v.size(); i++){ faceup(v[i].first); faceup(v[i].second); } return; }

컴파일 시 표준 에러 (stderr) 메시지

memory.cpp: In function 'void play()':
memory.cpp:6:5: error: 'vector' was not declared in this scope
    6 |     vector< pair<int, int> > v;
      |     ^~~~~~
memory.cpp:6:13: error: 'pair' was not declared in this scope
    6 |     vector< pair<int, int> > v;
      |             ^~~~
memory.cpp:6:18: error: expected primary-expression before 'int'
    6 |     vector< pair<int, int> > v;
      |                  ^~~
memory.cpp:8:9: error: 'v' was not declared in this scope
    8 |         v.pb(make_pair(0, 0));
      |         ^
memory.cpp:8:14: error: 'make_pair' was not declared in this scope
    8 |         v.pb(make_pair(0, 0));
      |              ^~~~~~~~~
memory.cpp:13:12: error: 'v' was not declared in this scope
   13 |         if(v[a - 'A'].first != 0){
      |            ^
memory.cpp:19:12: error: 'v' was not declared in this scope
   19 |         if(v[b - 'A'].first != 0){
      |            ^
memory.cpp:26:24: error: 'v' was not declared in this scope
   26 |     for(int i = 0; i < v.size(); i++){
      |                        ^