제출 #595975

#제출 시각아이디문제언어결과실행 시간메모리
595975chinmoy_101Best Place (NOI17_bestplace)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll n
    cin>>n;
    ll arr[n];
    ll ar[n];
    for(ll i=0; i<n; i++)
    {
        cin>>arr[i] >>ar[i];
    }
    sort(arr, arr+n);
    sort(ar, ar+n);
    cout<<arr[n/2] <<" " <<ar[n/2];
    return 0; 
}

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

bestplace.cpp: In function 'int main()':
bestplace.cpp:7:5: error: expected initializer before 'cin'
    7 |     cin>>n;
      |     ^~~
bestplace.cpp:8:12: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |     ll arr[n];
      |            ^
      |            yn
bestplace.cpp:12:14: error: 'arr' was not declared in this scope
   12 |         cin>>arr[i] >>ar[i];
      |              ^~~
bestplace.cpp:12:23: error: 'ar' was not declared in this scope
   12 |         cin>>arr[i] >>ar[i];
      |                       ^~
bestplace.cpp:14:10: error: 'arr' was not declared in this scope
   14 |     sort(arr, arr+n);
      |          ^~~
bestplace.cpp:15:10: error: 'ar' was not declared in this scope
   15 |     sort(ar, ar+n);
      |          ^~