Submission #1014833

#TimeUsernameProblemLanguageResultExecution timeMemory
1014833ASN49KTeams (IOI15_teams)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "teams.h" using namespace std; #define all(x) x.begin(),x.end() using pii=pair<int,int>; int n; vector<pii>a; void init(int N, int *A, int *B) { a.resize(N); n=N; for(int i=0;i<N;i++) { a[i] = make_pair(A[i] , B[i]); } sort(all(a)); } bool can(int m, int k[]) { multiset<int>mp; for(int i=0,l=0;i<m;i++) { while(l<n && a[l].first<=k[i]) { mp.insert(a[l++].second); } auto it=mp.begin(); while(mp.size() && *it<k[i]) { it=next(it); mp.erase(prev(it)); } if((int)mp.size()<k[i]) { return false; } for(int j=0;j<k[i];j++) { it=next(it); mp.erase(prev(it)); } } return true; }

Compilation message (stderr)

teams.cpp:20:6: error: ambiguating new declaration of 'bool can(int, int*)'
   20 | bool can(int m, int k[])
      |      ^~~
In file included from teams.cpp:2:
teams.h:5:5: note: old declaration 'int can(int, int*)'
    5 | int can(int M, int K[]);
      |     ^~~