답안 #1065822

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1065822 2024-08-19T12:02:29 Z sunboi Bikeparking (EGOI24_bikeparking) C++17
컴파일 오류
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];
      |             ^