제출 #262112

#제출 시각아이디문제언어결과실행 시간메모리
262112ElyesChaabouni팀들 (IOI15_teams)C++14
컴파일 에러
0 ms0 KiB
#include "teams.h" /*#pragma GCC optimize("O3")*/ #include<bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //#define ordered_set tree<int, null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> #define eps 1e-9 #define MOD1 998244353 #define MOD2 1000000007 #define INV_10 299473306 #define INF 1000000001 #define PI 3.14159265358979323846 using namespace std; int n; vector<pair<int, int> >v; bool compare(pair<int, int>a, pair<int, int>b) { if(a.second != b.second) return a.second < b.second; return a.first < b.first; } void init(int N, int A[], int B[]) { n=N; for(int i = 0; i < n; i++) v.push_back(make_pair(A[i], B[i])); sort(v.begin(), v.end(), compare); } int can(int M, int K[]) { sort(K, K+M); int idx=n-1; priority_queue<int>pq; for(int i = M-1; i >= 0; i--) { int cu=0; while(idx >= 0 && v[idx].second >= K[i]) pq.insert(v[idx].first); while(!pq.empty() && cu < K[i]) { if(pq.top() <= K[i]) cu++; pq.pop(); } if(cu!=K[i]) return 0; } return 1; }

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:37:7: error: 'class std::priority_queue<int>' has no member named 'insert'
    pq.insert(v[idx].first);
       ^~~~~~