제출 #1017871

#제출 시각아이디문제언어결과실행 시간메모리
1017871parsadox2팀들 (IOI15_teams)C++17
34 / 100
4078 ms31676 KiB
#include <bits/stdc++.h> #include "teams.h" using namespace std; #define F first #define S second const int N = 1e5 + 10; int n; vector <pair <int , int>> all; void init(int nn , int A[] , int B[]) { n = nn; for(int i = 0 ; i < n ; i++) all.push_back(make_pair(A[i] , B[i])); sort(all.begin() , all.end()); } int can(int m , int k[]) { sort(k , k + m); int flg = 1; multiset <int> st; int pos = 0; for(int i = 0 ; i < n ; i++) { if(pos == m) break; if(k[pos] < all[i].F) { while(!st.empty() && *st.begin() < k[pos]) st.erase(st.begin()); if(st.size() < k[pos]) { flg = 0; break; } for(int j = 0 ; j < k[pos] ; j++) st.erase(st.begin()); pos++; i--; continue; } st.insert(all[i].S); } if(flg == 0) return flg; while(pos != m) { while(!st.empty() && *st.begin() < k[pos]) st.erase(st.begin()); if(st.size() < k[pos]) { flg = false; break; } for(int j = 0 ; j < k[pos] ; j++) st.erase(st.begin()); pos++; } return flg; }

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:35:17: warning: comparison of integer expressions of different signedness: 'std::multiset<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   35 |    if(st.size() < k[pos])
      |       ~~~~~~~~~~^~~~~~~~
teams.cpp:54:16: warning: comparison of integer expressions of different signedness: 'std::multiset<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   54 |   if(st.size() < k[pos])
      |      ~~~~~~~~~~^~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...