Submission #298269

#TimeUsernameProblemLanguageResultExecution timeMemory
298269aloo123Memory (IOI10_memory)C++14
Compilation error
0 ms0 KiB
// #include "grader.h" #include "memory.h" #include <bits/stdc++.h> char a[51]; bool vis[51]; map<char,pair<int,int>> m; void play() { for(int i = 1;i<=50;i++){ a[i] = faceup(i); } for(int i =1;i<=50;i++){ if(vis[i] == false) continue; for(int j = 1;j<=50;j++){ if(vis[j] == false && a[i] == a[j]){ m[a[i]] = make_pair(i,j); vis[j] = true; vis[i] = true; break; } } } for(char c = 'A';c<='Y';c++){ faceup(m[c].first); faceup(m[c].second); } }

Compilation message (stderr)

memory.cpp:6:1: error: 'map' does not name a type
    6 | map<char,pair<int,int>> m;
      | ^~~
memory.cpp: In function 'void play()':
memory.cpp:9:16: error: 'faceup' was not declared in this scope
    9 |         a[i] = faceup(i);
      |                ^~~~~~
memory.cpp:15:17: error: 'm' was not declared in this scope
   15 |                 m[a[i]] = make_pair(i,j);
      |                 ^
memory.cpp:15:27: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'?
   15 |                 m[a[i]] = make_pair(i,j);
      |                           ^~~~~~~~~
      |                           std::make_pair
In file included from /usr/include/c++/9/bits/stl_algobase.h:64,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from memory.cpp:3:
/usr/include/c++/9/bits/stl_pair.h:524:5: note: 'std::make_pair' declared here
  524 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
memory.cpp:23:16: error: 'm' was not declared in this scope
   23 |         faceup(m[c].first);
      |                ^
memory.cpp:23:9: error: 'faceup' was not declared in this scope
   23 |         faceup(m[c].first);
      |         ^~~~~~