Submission #532250

#TimeUsernameProblemLanguageResultExecution timeMemory
532250devariaotaBest Place (NOI17_bestplace)C++17
0 / 100
1 ms444 KiB
#include <bits/stdc++.h> using namespace std; int arr[2][111111]; int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d%d",arr[0] + i,arr[i] + 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; }

Compilation message (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[i] + 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...