Submission #147608

#TimeUsernameProblemLanguageResultExecution timeMemory
147608nandonathanielTeams (IOI15_teams)C++14
Compilation error
0 ms0 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; typedef pair<int,int> pii; pii V[100005]; bool sudah[100005]; bool cmp(pii x,pii y){ return x.second<y.second; } void init(int N, int A[], int B[]) { for(int i=0;i<N;i++)V[i]={A[i],B[i]}; sort(V,V+N,cmp); } int can(int M, int K[]) { memset(sudah,false,sizeof(sudah)); for(int i=0;i<M;i++){ int brp=0; bool ya=false; for(int j=0;j<N;j++){ if(!sudah[i] && K[i]>=V[j].first && K[i]<=V[j].second){ brp++; sudah[i]=true; } if(brp==K[i]){ ya=true; break; } } if(!ya)return 0; } return 1; }

Compilation message (stderr)

teams.cpp: In function 'int can(int, int*)':
teams.cpp:22:17: error: 'N' was not declared in this scope
   for(int j=0;j<N;j++){
                 ^