제출 #1276788

#제출 시각아이디문제언어결과실행 시간메모리
1276788sagnbaevvMemory (IOI10_memory)C++20
컴파일 에러
0 ms0 KiB
#include "grader.h" #include "memory.h" void play() { map <char, pair<int, int>>m; for (int i = 1; i <= 50; i++) { char c = faceup(i); if (m[c].first == 0) { m[c].second = i; } else { m[c].first = i; } } for (auto x : m) { faceup(x.second.first); faceup(x.second.second); } }

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

memory.cpp: In function 'void play()':
memory.cpp:5:20: error: 'pair' was not declared in this scope
    5 |         map <char, pair<int, int>>m;
      |                    ^~~~
memory.cpp:5:9: error: 'map' was not declared in this scope
    5 |         map <char, pair<int, int>>m;
      |         ^~~
memory.cpp:5:14: error: expected primary-expression before 'char'
    5 |         map <char, pair<int, int>>m;
      |              ^~~~
memory.cpp:8:21: error: 'm' was not declared in this scope
    8 |                 if (m[c].first == 0) {
      |                     ^
memory.cpp:15:23: error: 'm' was not declared in this scope
   15 |         for (auto x : m) {
      |                       ^