Submission #67044

#TimeUsernameProblemLanguageResultExecution timeMemory
67044nvmdava팀들 (IOI15_teams)C++17
Compilation error
0 ms0 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; struct unit{ int l, r; }; vector<unit> v; void init(int N, int A[], int B[]) { sort(A, A + N); sort(B, B + N); unit t; for(i = 0; i < N; i++){ t.l = A[i]; t.r = B[i]; v.push_back(t); } } int can(int M, int K[]) { int t = K[0], i = 0; for(auto x : v){ if(K[i] < x.l){ return 0; } if(K[i] <= x.r){ t--; if(t == 0){ i++; if(i == M){ return 1; } t = K[i]; } } } return 0; }

Compilation message (stderr)

teams.cpp: In function 'void init(int, int*, int*)':
teams.cpp:13:6: error: 'i' was not declared in this scope
  for(i = 0; i < N; i++){
      ^