제출 #502147

#제출 시각아이디문제언어결과실행 시간메모리
502147dnauxMemory (IOI10_memory)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "grader.h"
#include "memory.h"

using namespace std;;

void play(){
   map<char,int> mymp;
   vector<pair<int,int>> ans;
   for(int i = 1; i <= 50; i++){
      char c = faceup(i);
      if(mymp[c])ans.pb(mp(mymp[c],i));
      else mymp[c] = i;
   }
   for(auto i:ans){
      faceup(i.first);
      faceup(i.second);
   }
   return;
}

컴파일 시 표준 에러 (stderr) 메시지

memory.cpp: In function 'void play()':
memory.cpp:12:22: error: 'class std::vector<std::pair<int, int> >' has no member named 'pb'
   12 |       if(mymp[c])ans.pb(mp(mymp[c],i));
      |                      ^~
memory.cpp:12:25: error: 'mp' was not declared in this scope
   12 |       if(mymp[c])ans.pb(mp(mymp[c],i));
      |                         ^~