제출 #532252

#제출 시각아이디문제언어결과실행 시간메모리
532252kebineBest Place (NOI17_bestplace)C++17
33 / 100
38 ms2948 KiB
#include <bits/stdc++.h>
using namespace std;
int arr[2][100111];
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d%d",arr[0] + i,arr[1] + i);
    }
    for(int j = 0;j<2;j++){
        sort(arr[j],arr[j]+n);
        int mid = n / 2;
        if(n % 2 == 0) printf("%d ",(arr[j][mid] + arr[j][mid+1]) /2 );
        else printf("%d ",arr[j][mid]);
    }
    return 0;
}

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

bestplace.cpp: In function 'int main()':
bestplace.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
bestplace.cpp:8:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |         scanf("%d%d",arr[0] + i,arr[1] + i);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...