Submission #669134

#TimeUsernameProblemLanguageResultExecution timeMemory
669134ToxtaqMemory (IOI10_memory)C++17
Compilation error
0 ms0 KiB
#include "grader.h"
#include<bits/stdc++.h>
using namespace std;
void play(){
    int cnt = 0;
    map<char, pair<int, int>>mp;
    for(int i = 1;i <= 50;++i){
        char c = faceup(i);
        if(mp[c].first <= 50 && mp[c].first >= 1)mp[c].second = i;
        else mp[c].first = i;
    }
    for(auto i = mp.begin();i != mp.end();++i){
        char c1 = (i->first);
        char c2 = faceup(i->second);
        cnt++;
        if(cnt == 25)return;
    }
}

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:14:29: error: cannot convert 'std::pair<int, int>' to 'int'
   14 |         char c2 = faceup(i->second);
      |                          ~~~^~~~~~
      |                             |
      |                             std::pair<int, int>
In file included from memory.cpp:1:
grader.h:1:17: note:   initializing argument 1 of 'char faceup(int)'
    1 | char faceup(int C);
      |             ~~~~^
memory.cpp:13:14: warning: unused variable 'c1' [-Wunused-variable]
   13 |         char c1 = (i->first);
      |              ^~
memory.cpp:14:14: warning: unused variable 'c2' [-Wunused-variable]
   14 |         char c2 = faceup(i->second);
      |              ^~