제출 #130983

#제출 시각아이디문제언어결과실행 시간메모리
130983mirbek01팀들 (IOI15_teams)C++11
13 / 100
4086 ms32028 KiB
# include "teams.h" //# include "grader.cpp" # include <bits/stdc++.h> using namespace std; vector < pair <int, int> > v; void init(int N, int A[], int B[]) { for(int i = 0; i < N; i ++) v.emplace_back(make_pair(B[i], A[i])); sort(v.begin(), v.end()); } int can(int M, int K[]) { sort(K, K + M); set < pair <int, int> > st; int pt = 0; for(int i = 0; i < M; i ++){ int x = K[i]; while(pt < v.size() && x > 0){ st.insert({v[pt].second, pt}); pt ++; while(x > 0 && !st.empty()){ pair <int, int> p = *st.begin(); if(p.first <= K[i] && K[i] <= v[p.second].first){ st.erase(st.begin()); x --; } else { if(v[p.second].first < K[i]){ st.erase(st.begin()); } else { break; } } } } while(x > 0 && !st.empty()){ pair <int, int> p = *st.begin(); if(p.first <= K[i] && K[i] <= v[p.second].first){ st.erase(st.begin()); x --; } else { if(v[p.second].first < K[i]){ st.erase(st.begin()); } else { break; } } } if(x > 0) return 0; } return 1; }

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:21:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             while(pt < v.size() && x > 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...