Submission #337671

#TimeUsernameProblemLanguageResultExecution timeMemory
337671aris12345678Reversing a Sequence (IOI16_reverse)C++14
Compilation error
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); }*/

Compilation message (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;
      |                    ^