Submission #1065822

#TimeUsernameProblemLanguageResultExecution timeMemory
1065822sunboiBikeparking (EGOI24_bikeparking)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;


int main(){
    int n; cin >> n;
    vector<int> x(n), y(n);
    for (int i = 0; i < n; i++) cin >> x[i];
    for (int i = 0; i < n; i++) cin >> y[i];
    ans = x[i] * (n - 1) - x[i];
    cout << ans << endl;
}

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     ans = x[i] * (n - 1) - x[i];
      |     ^~~
      |     abs
Main.cpp:10:13: error: 'i' was not declared in this scope
   10 |     ans = x[i] * (n - 1) - x[i];
      |             ^