Submission #992588

# Submission time Handle Problem Language Result Execution time Memory
992588 2024-06-04T18:08:47 Z KasymK Magic Show (APIO24_show) C++17
Compilation error
0 ms 0 KB
#include "bits/stdc++.h"
#include "Alice.h"
using namespace std;

vector<pair<int, int>> Alice(){
    int x = setN(5000);
    vector<pair<int, int>> v;
    for(int i = 1; i <= 5000; ++i)
        if(i != x)
            v.push_back({i, x});
    return v;
}
#include "bits/stdc++.h"
#include "Bob.h"
using namespace std;

int Bob(vector<pair<int, int>> v){
    map<int, int> mp;
    for(auto &i : v)
        mp[i.second]++;
    int mx = -1, answer = -1;
    for(auto &i : v)
        mx = max(mx, mp[i.second]);
    for(auto &i : v)
        if(mx == mp[i.second]){
            answer = i.second;
            break;
        }
    return answer;
}

Compilation message

Bob.cpp:5:5: error: ambiguating new declaration of 'int Bob(std::vector<std::pair<int, int> >)'
    5 | int Bob(vector<pair<int, int>> v){
      |     ^~~
In file included from Bob.cpp:2:
Bob.h:3:11: note: old declaration 'long long int Bob(std::vector<std::pair<int, int> >)'
    3 | long long Bob(std::vector<std::pair<int,int>> V);
      |           ^~~