Submission #1178502

#TimeUsernameProblemLanguageResultExecution timeMemory
1178502BlockOGTeams (IOI15_teams)C++20
Compilation error
0 ms0 KiB
#include "teams.h" #include <bits/stdc++.h> // mrrrrrroooowwww :3c // vivid/stasis! free on steam using namespace std; int n; pair<int, int> a[500000]; pair<int, int> b[500000]; void init(int N, int A[], int B[]) { n = N; for (int i = 0; i < n; i++) b[i] = a[i] = {A[i], B[i]}; sort(a, a + n); // sort(b, b + n, [](pair<int, int> &a, pair<int, int> &b){ return pair(a.second, a.first) > pair(b.second, b.first) }); } bool can(int m, int k[]) { sort(k, k + m); int i = 0, j = 0, c = k[0]; for (; i < m && j < n;) { if (c) { if (a[j].first <= k[i] && k[i] <= a[j].second) { c--; if (c == 0) i++; } j++; } else c = k[i]; } return i == m; }

Compilation message (stderr)

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