Submission #1051566

#TimeUsernameProblemLanguageResultExecution timeMemory
1051566MarwenElarbiKeys (IOI21_keys)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; std::vector<int> find_reachable(std::vector<int> r, std::vector<int> u, std::vector<int> v, std::vector<int> c) { std::vector<int> ans(r.size(),1); int cnt=0; for (int i = 0; i < (int)r.size(); ++i) { cnt+=(r[i]==0); } if(cnt==n||cnt==0) return ans; for (int i = 0; i < (int)r.size(); ++i) { if(r[i]==0) ans[i]=0; } return ans; }

Compilation message (stderr)

keys.cpp: In function 'std::vector<int> find_reachable(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
keys.cpp:11:10: error: 'n' was not declared in this scope
   11 |  if(cnt==n||cnt==0) return ans;
      |          ^