Submission #209367

#TimeUsernameProblemLanguageResultExecution timeMemory
209367autumn_eelTeams (IOI15_teams)C++14
34 / 100
4062 ms23012 KiB
#include "teams.h" #include <bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; typedef pair<int,int>P; P p[600000]; int n; void init(int N, int A[], int B[]) { n=N; rep(i,N)p[i]=P(A[i],B[i]); sort(p,p+N); } int can(int M, int K[]) { sort(K,K+M); priority_queue<P,vector<P>,greater<P>>que; int s=0; rep(i,M){ int x=K[i]; while(s<n&&p[s].first<=x)que.push(P(p[s].second,p[s].first)),s++; while(!que.empty()&&que.top().first<x)que.pop(); if(que.size()<x)return 0; rep(i,x)que.pop(); } return 1; }

Compilation message (stderr)

teams.cpp: In function 'int can(int, int*)':
teams.cpp:24:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if(que.size()<x)return 0;
      ~~~~~~~~~~^~
teams.cpp:25:7: warning: declaration of 'i' shadows a previous local [-Wshadow]
   rep(i,x)que.pop();
       ^
teams.cpp:3:25: note: in definition of macro 'rep'
 #define rep(i,n)for(int i=0;i<(n);i++)
                         ^
teams.cpp:20:6: note: shadowed declaration is here
  rep(i,M){
      ^
teams.cpp:3:25: note: in definition of macro 'rep'
 #define rep(i,n)for(int i=0;i<(n);i++)
                         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...