제출 #783357

#제출 시각아이디문제언어결과실행 시간메모리
783357MatblubeTeams (IOI15_teams)C++14
컴파일 에러
0 ms0 KiB
#include "teams.h"
#include <iostream>
#include <iomanip>
#include <string>
#include <math.h>
#include <algorithm>
#include <cstring>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long ll;
#define dbg(x) cerr<<#x<<": "<<x<<"\n";
#define fr(i, x) for(ll i=0 ; i<x ; i++)
#define fra(x, v) for(auto x:v)
#define fra1(x,v) for(auto &x:v)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define pb(x) push_back(x)
#define F first
#define S second

const ll maxN=5e6;
ll n;
pair<ll, ll> vp[maxN];
bool uwu[maxN];

void init(int N, int A[], int B[]) {
    n=N;
    fr(i, N){
        vp[i].F=A[i];
        vp[i].S=B[i];
    }
    sort(vp, vp+n);
}

int can(int M, int K[]) {
    sort(k, k+m);
    ll cc=0;
    fill(uwu, uwu+maxN, 0);
    fr(i, M){
        cc=0;
        fr(j, n){
            if(cc>=K[i]) break;
            if(uwu[j] || vp[j].F<K[i] || vp[j].S>K[i]) continue;
            cc++;
            uwu[j]=1;
        }
        if(cc!=K[i]) return 0;
    }
	return 1;
}

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:42:10: error: 'k' was not declared in this scope
   42 |     sort(k, k+m);
      |          ^
teams.cpp:42:15: error: 'm' was not declared in this scope
   42 |     sort(k, k+m);
      |               ^