Submission #872928

#TimeUsernameProblemLanguageResultExecution timeMemory
872928vjudge1Best Place (NOI17_bestplace)C++14
Compilation error
0 ms0 KiB
#include <iostream>
#include <algorithm>

using namespace std;

int main(){
    int N  = 0;
    cin >> N;
    int a[i];
    int b[i];
    for(int i = 0; i < N; i++){
        cin >> a[i];
        cin >> b[i];
    }
    sort(a, a+N);
    sort(b, b+N);
    cout << a[N/2] << " ";
    cout << b[N/2];
}

Compilation message (stderr)

bestplace.cpp: In function 'int main()':
bestplace.cpp:9:11: error: 'i' was not declared in this scope
    9 |     int a[i];
      |           ^
bestplace.cpp:12:16: error: 'a' was not declared in this scope
   12 |         cin >> a[i];
      |                ^
bestplace.cpp:13:16: error: 'b' was not declared in this scope
   13 |         cin >> b[i];
      |                ^
bestplace.cpp:15:10: error: 'a' was not declared in this scope
   15 |     sort(a, a+N);
      |          ^
bestplace.cpp:16:10: error: 'b' was not declared in this scope
   16 |     sort(b, b+N);
      |          ^