제출 #337671

#제출 시각아이디문제언어결과실행 시간메모리
337671aris12345678뒤집기 (IOI16_reverse)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;

const int mxN = 1e5+5;

vector<long long> reverse(vector<long long> a) {
    int i = 0, j = n-1;
    while(i < j) {
        swap(a[i], a[j]);
        ++i, ++j;
    }
    return a;
}

/*int main() {
    ios::sync_with_stdio(false); cin.tie(0);

}*/

컴파일 시 표준 에러 (stderr) 메시지

reverse.cpp: In function 'std::vector<long long int> reverse(std::vector<long long int>)':
reverse.cpp:8:20: error: 'n' was not declared in this scope
    8 |     int i = 0, j = n-1;
      |                    ^