Submission #337671

# Submission time Handle Problem Language Result Execution time Memory
337671 2020-12-21T11:34:01 Z aris12345678 Reversing a Sequence (IOI16_reverse) C++14
Compilation error
0 ms 0 KB
#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);

}*/

Compilation message

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