Submission #602019

#TimeUsernameProblemLanguageResultExecution timeMemory
602019AmirElarbi팀들 (IOI15_teams)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#define vi vector<int>
#define gi greater<int>
#define gr greater
#define ve vector
#define ll long long
#define vf vector<float>
#define vll vector<pair<ll,ll>>
#define ii pair<int,int>
#define pll pair<ll,ll>
#define vvi vector<vi>
#define vii vector<ii>
#define gii greater<ii>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF 1e9
#define eps 1e-7
#define eps1 1e-2
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX_A 2e5+5
using namespace std;
const int MOD = 1e9+7;
const int nax = 2e5+5;
typedef complex<int> Point;
#define X real()
#define Y imag()

#include "teams.h"
vii students;
void init(int N, int A[], int B[]) {
    for (int i = 0; i < N; ++i)
    {
        students.pb({A[i], B[i]});
    }
    sort(students.begin(), students.end());
}

int can(int M, int K[]) {
    priority_queue<int> pq;
    vi k;
    for (int i = 0; i < M; ++i)
    {
        k.pb(K[i]);
    }
    sort(k.begin(), k.end());
    int j = 0;
    for (int i = 0; i < n; ++i)
    {
        if(s[i].fi <= k[j]){
            pq.push(s[i].se);
        } else {
            return 0;
        }
        while(!pq.empty() && pq.front() < k[j]){
            pq.pop();
        }
        while(j < M){
            while(!pq.empty() && pq.front() >= k[j] && k[j] != 0){
                pq.pop(); 
                k[j]--;
            }
            if(!k[j]) j++;
            else break;
        }
    }
    return 1;
}

Compilation message (stderr)

teams.cpp: In function 'int can(int, int*)':
teams.cpp:49:25: error: 'n' was not declared in this scope
   49 |     for (int i = 0; i < n; ++i)
      |                         ^
teams.cpp:51:12: error: 's' was not declared in this scope
   51 |         if(s[i].fi <= k[j]){
      |            ^
teams.cpp:56:33: error: 'class std::priority_queue<int>' has no member named 'front'
   56 |         while(!pq.empty() && pq.front() < k[j]){
      |                                 ^~~~~
teams.cpp:60:37: error: 'class std::priority_queue<int>' has no member named 'front'
   60 |             while(!pq.empty() && pq.front() >= k[j] && k[j] != 0){
      |                                     ^~~~~