Submission #1008729

#TimeUsernameProblemLanguageResultExecution timeMemory
1008729Rolo678Labels (NOI20_labels)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >>n; vector<int>d(n); for(int i = 1;i<n;i++) { cin >>d[i]; } if(abs(d[1]) != 2*n-2) cout<<-1<<'\n'; else if (d[i] == -2*n + 2) cout<< n-1 << ' '<< -n+1 <<'\n'; else if (d[i] == 2*n-2) cout<< -n+1 << ' '<< n-1 <<'\n'; }

Compilation message (stderr)

Labels.cpp: In function 'int main()':
Labels.cpp:14:14: error: 'i' was not declared in this scope
   14 |   else if (d[i] == -2*n + 2) cout<< n-1 << ' '<< -n+1 <<'\n';
      |              ^