답안 #384598

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
384598 2021-04-01T21:35:25 Z fadi57 CONSUL (info1cup19_consul) C++14
컴파일 오류
0 ms 0 KB
#include "grader.cpp"
//#include<bits/stdc++.h>
using namespace std;

void solve(int n)
{
    map<int,int>mp;
    /// insert your code
    /// for example
    int z=n/3;
    for(int i=1;i<=n;i++){
            int me=kth(i);
    mp[me]++;
        if(mp[me]>z){
            say_answer(me);
            break;
        }
    }

}

Compilation message

consul.cpp: In function 'void solve(int)':
consul.cpp:7:5: error: 'map' was not declared in this scope
    7 |     map<int,int>mp;
      |     ^~~
consul.cpp:2:1: note: 'std::map' is defined in header '<map>'; did you forget to '#include <map>'?
    1 | #include "grader.cpp"
  +++ |+#include <map>
    2 | //#include<bits/stdc++.h>
consul.cpp:7:9: error: expected primary-expression before 'int'
    7 |     map<int,int>mp;
      |         ^~~
consul.cpp:13:5: error: 'mp' was not declared in this scope; did you mean 'me'?
   13 |     mp[me]++;
      |     ^~
      |     me