제출 #832404

#제출 시각아이디문제언어결과실행 시간메모리
832404Valaki2팀들 (IOI15_teams)C++14
34 / 100
4078 ms12276 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define pii pair<int, int> #define fi first #define se second int n; vector<pii> v; void init(int N, int A[], int B[]) { n = N; v.resize(n); for(int i = 0; i < n; i++) { v[i] = mp(A[i], B[i]); } sort(v.begin(), v.end()); } int can(int M, int K[]) { vector<int> s; for(int i = 0; i < M; i++) { s.pb(K[i]); } sort(s.begin(), s.end()); int ptr = 0; priority_queue<int> q; for(int cur : s) { while(ptr < n && v[ptr].fi <= cur) { q.push(-v[ptr].se); ptr++; } while(!q.empty() && -q.top() < cur) { q.pop(); } if(q.size() < cur) { return 0; } for(int i = 0; i < cur; i++) { q.pop(); } } return 1; }

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:40:15: warning: comparison of integer expressions of different signedness: 'std::priority_queue<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   40 |   if(q.size() < cur) {
      |      ~~~~~~~~~^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...