Submission #1207190

#TimeUsernameProblemLanguageResultExecution timeMemory
1207190DpikaMemory (IOI10_memory)C++20
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" #include <bits/stdc++.h> vector<pair<int,int>>v(25); void play() { int i; char a, b; for (i=0; i<100; i=i+2) { if(i>=50){ int x,y; x=v[(i-50)/2].first; y=v[(i-50)/2].second; a = faceup(x); b = faceup(y); } else{ a = faceup(i+1); b = faceup(i+2); v[a-65].first=i+1; v[b-65].first=i+2; } } }

Compilation message (stderr)

memory.cpp:4:8: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    4 | vector<pair<int,int>>v(25);
      |        ^~~~
      |        std::pair
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from memory.cpp:3:
/usr/include/c++/11/bits/stl_pair.h:211:12: note: 'std::pair' declared here
  211 |     struct pair
      |            ^~~~
memory.cpp:4:8: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    4 | vector<pair<int,int>>v(25);
      |        ^~~~
      |        std::pair
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from memory.cpp:3:
/usr/include/c++/11/bits/stl_pair.h:211:12: note: 'std::pair' declared here
  211 |     struct pair
      |            ^~~~
memory.cpp:4:8: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    4 | vector<pair<int,int>>v(25);
      |        ^~~~
      |        std::pair
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from memory.cpp:3:
/usr/include/c++/11/bits/stl_pair.h:211:12: note: 'std::pair' declared here
  211 |     struct pair
      |            ^~~~
memory.cpp:4:8: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    4 | vector<pair<int,int>>v(25);
      |        ^~~~
      |        std::pair
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from memory.cpp:3:
/usr/include/c++/11/bits/stl_pair.h:211:12: note: 'std::pair' declared here
  211 |     struct pair
      |            ^~~~
memory.cpp:4:8: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    4 | vector<pair<int,int>>v(25);
      |        ^~~~
      |        std::pair
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from memory.cpp:3:
/usr/include/c++/11/bits/stl_pair.h:211:12: note: 'std::pair' declared here
  211 |     struct pair
      |            ^~~~
memory.cpp:4:8: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    4 | vector<pair<int,int>>v(25);
      |        ^~~~
      |        std::pair
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from memory.cpp:3:
/usr/include/c++/11/bits/stl_pair.h:211:12: note: 'std::pair' declared here
  211 |     struct pair
      |            ^~~~
memory.cpp:4:8: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    4 | vector<pair<int,int>>v(25);
      |        ^~~~
      |        std::pair
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from memory.cpp:3:
/usr/include/c++/11/bits/stl_pair.h:211:12: note: 'std::pair' declared here
  211 |     struct pair
      |            ^~~~
memory.cpp:4:8: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    4 | vector<pair<int,int>>v(25);
      |        ^~~~
      |        std::pair
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from memory.cpp:3:
/usr/include/c++/11/bits/stl_pair.h:211:12: note: 'std::pair' declared here
  211 |     struct pair
      |            ^~~~
memory.cpp:4:8: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
    4 | vector<pair<int,int>>v(25);
      |        ^~~~
      |        std::pair
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from memory.cpp:3:
/usr/include/c++/11/bits/stl_pair.h:211:12: note: 'std::pair' declared here
  211 |     struct pair
      |            ^~~~
memory.cpp:4:1: error: 'vector' does not name a type
    4 | vector<pair<int,int>>v(25);
      | ^~~~~~
memory.cpp: In function 'void play()':
memory.cpp:11:12: error: 'v' was not declared in this scope
   11 |          x=v[(i-50)/2].first;
      |            ^
memory.cpp:19:10: error: 'v' was not declared in this scope
   19 |          v[a-65].first=i+1;
      |          ^