Submission #1276788

#TimeUsernameProblemLanguageResultExecution timeMemory
1276788sagnbaevvMemory (IOI10_memory)C++20
Compilation error
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);
	}
}

Compilation message (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) {
      |                       ^