Submission #262110

#TimeUsernameProblemLanguageResultExecution timeMemory
262110ElyesChaabouni팀들 (IOI15_teams)C++14
Compilation error
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>;
	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;
}

Compilation message (stderr)

teams.cpp: In function 'void init(int, int*, int*)':
teams.cpp:25:25: error: 'a' was not declared in this scope
   v.push_back(make_pair(a[i], b[i]));
                         ^
teams.cpp:25:31: error: 'b' was not declared in this scope
   v.push_back(make_pair(a[i], b[i]));
                               ^
teams.cpp:22:24: warning: unused parameter 'A' [-Wunused-parameter]
 void init(int N, int A[], int B[]) {
                        ^
teams.cpp:22:33: warning: unused parameter 'B' [-Wunused-parameter]
 void init(int N, int A[], int B[]) {
                                 ^
teams.cpp: In function 'int can(int, int*)':
teams.cpp:32:2: error: declaration does not declare anything [-fpermissive]
  priority_queue<int>;
  ^~~~~~~~~~~~~~~~~~~
teams.cpp:37:4: error: 'pq' was not declared in this scope
    pq.insert(v[idx].first);
    ^~
teams.cpp:38:10: error: 'pq' was not declared in this scope
   while(!pq.empty() && cu < K[i])
          ^~