Submission #717683

#TimeUsernameProblemLanguageResultExecution timeMemory
717683nikosMemory (IOI10_memory)C++17
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" #include <bits/stdc++.h> using namespace std; void play() { char a, b; vector< pair<int, int> > v; for(int i = 0; i < 25; i++){ v.pb(make_pair(0, 0)); } for(int i = 1; i < 50; i += 2){ a = faceup(i); b = faceup(i + 1); if(v[a - 'A'].first != 0){ v[a - 'A'].first = i; } else{ v[a - 'A'].second = i; } if(v[b - 'A'].first != 0){ v[b - 'A'].first = i; } else{ v[b - 'A'].second = i; } } for(int i = 0; i < v.size(); i++){ faceup(v[i].first); faceup(v[i].second); } return; }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:9:11: error: 'class std::vector<std::pair<int, int> >' has no member named 'pb'
    9 |         v.pb(make_pair(0, 0));
      |           ^~
memory.cpp:27:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |     for(int i = 0; i < v.size(); i++){
      |                    ~~^~~~~~~~~~