Submission #63328

#TimeUsernameProblemLanguageResultExecution timeMemory
63328hamzqq9Teams (IOI15_teams)C++14
0 / 100
4035 ms11468 KiB
#include "teams.h" #include<bits/stdc++.h> using namespace std; #define st first #define nd second #define MAX 100005 #define sz(x) ((int)x.size()) int N; pair<int,int> A[MAX]; void init(int N, int A[], int B[]) { ::N=N; for(int i=0;i<N;i++) ::A[i+1].st=A[i],::A[i].nd=B[i]; sort(::A+1,::A+1+N); } int can(int M, int K[]) { multiset<int> s; int tut=0; for(int i=0;i<M;i++) { while(sz(s) && *s.begin()<K[i]) s.erase(s.begin()); while(tut+1<=N && A[tut+1].st<=K[i]) { tut++; s.insert(A[tut].nd); } if(sz(s)<K[i]) return 0; while(K[i]--) { s.erase(s.begin()); } } return 1; }

Compilation message (stderr)

teams.cpp: In function 'void init(int, int*, int*)':
teams.cpp:12:34: warning: declaration of 'A' shadows a global declaration [-Wshadow]
 void init(int N, int A[], int B[]) {
                                  ^
teams.cpp:10:15: note: shadowed declaration is here
 pair<int,int> A[MAX];
               ^
teams.cpp:12:34: warning: declaration of 'N' shadows a global declaration [-Wshadow]
 void init(int N, int A[], int B[]) {
                                  ^
teams.cpp:9:5: note: shadowed declaration is here
 int N;
     ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...