Submission #697622

#TimeUsernameProblemLanguageResultExecution timeMemory
697622europiumMemory (IOI10_memory)C++17
Compilation error
0 ms0 KiB
#include "grader.h"
#include "memory.h"
#include <bits/stdc++.h>

void play() {
    char a, b;
    map<char,vector<int>> c;

    for (int i = 1; i <= 50; i += 2){
        a = faceup(i), b = faceup(i + 1);

        c[a].push_back(i);
        c[b].push_back(i + 1);
    }

    for (auto [k, v] : c){
        a = faceup(v[0]);
        b = faceup(v[1]);
    }
}

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:7:5: error: 'map' was not declared in this scope
    7 |     map<char,vector<int>> c;
      |     ^~~
memory.cpp:7:5: note: suggested alternatives:
In file included from /usr/include/c++/10/map:61,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
                 from memory.cpp:3:
/usr/include/c++/10/bits/stl_map.h:100:11: note:   'std::map'
  100 |     class map
      |           ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
                 from memory.cpp:3:
/usr/include/c++/10/map:78:13: note:   'std::pmr::map'
   78 |       using map
      |             ^~~
memory.cpp:7:9: error: expected primary-expression before 'char'
    7 |     map<char,vector<int>> c;
      |         ^~~~
memory.cpp:12:9: error: 'c' was not declared in this scope
   12 |         c[a].push_back(i);
      |         ^
memory.cpp:16:24: error: 'c' was not declared in this scope
   16 |     for (auto [k, v] : c){
      |                        ^