제출 #742818

#제출 시각아이디문제언어결과실행 시간메모리
742818Abrar_Al_Samit팀들 (IOI15_teams)C++17
0 / 100
4097 ms15940 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; const int nax = 100; int n; vector<pair<int,int>>a; void init(int N, int A[], int B[]) { n = N; for(int i=0; i<n; ++i) { a.emplace_back(A[i], B[i]); } sort(a.begin(), a.end()); } int can(int M, int K[]) { int at = 0; sort(K, K+M); set<int>res; for(int i=0; i<M; ++i) { while(at < n && a[at].first<=K[i]) { if(a[at].second >= K[i]) { res.insert(a[at].second); } ++at; } while(!res.empty() && *res.begin()<K[i]) { res.erase(res.begin()); } if(res.size() < K[i]) return 0; while(K[i]--) { res.erase(res.begin()); } } return 1; }

컴파일 시 표준 에러 (stderr) 메시지

teams.cpp: In function 'int can(int, int*)':
teams.cpp:31:17: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   31 |   if(res.size() < K[i]) return 0;
      |      ~~~~~~~~~~~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...