제출 #209543

#제출 시각아이디문제언어결과실행 시간메모리
209543model_codeBest Place (NOI17_bestplace)C++17
100 / 100
81 ms3308 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); vector<int> x, y; for(int i = 0; i < n; i++) { int a, b; scanf("%d%d", &a, &b); x.push_back(a); y.push_back(b); } sort(x.begin(), x.end()); sort(y.begin(), y.end()); if(n % 2 == 1) { printf("%d %d\n", x[n / 2], y[n / 2]); }else { printf("%d %d\n", (x[n / 2] + x[n / 2 - 1]) / 2, (y[n / 2] + y[n / 2 - 1]) / 2); } return 0; }

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

bestplace.cpp: In function 'int main()':
bestplace.cpp:4:15: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   int n; scanf("%d", &n);
          ~~~~~^~~~~~~~~~
bestplace.cpp:7:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int a, b; scanf("%d%d", &a, &b);
               ~~~~~^~~~~~~~~~~~~~~~
#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...