Submission #1065822

# Submission time Handle Problem Language Result Execution time Memory
1065822 2024-08-19T12:02:29 Z sunboi Bikeparking (EGOI24_bikeparking) C++17
Compilation error
0 ms 0 KB
#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

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];
      |             ^