답안 #762879

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
762879 2023-06-21T22:54:53 Z Trunkty CONSUL (info1cup19_consul) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define int ll

#include "grader_consul.h"

map<int,int> mp;
bool vis[1005];

void solve(int n){
    for(int i=1;i<=n;i++){
        vis[i] = false;
    }
    mp.clear();
    srand(314);
    for(int i=1;i<=50;i++){
        int curr = rand()%n+1;
        while(vis[curr]){
            curr = rand()%n+1;
        }
        vis[curr] = true;
        mp[kth(curr)]++;
    }
    vector<vector<int>> v;
    for(pair<int,int> i:mp){
        v.push_back({i.second,i.first});
    }
    sort(v.begin(),v.end(),greater<vector<int>>());
    int vs = v.size();
    for(int i=0;i<min(vs,10);i++){
        if(cnt(v[i][1])>n/3){
            say_answer(v[i][1]);
            return;
        }
    }
    say_answer(-1);
}

Compilation message

consul.cpp:6:10: fatal error: grader_consul.h: No such file or directory
    6 | #include "grader_consul.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.