Submission #1108998

#TimeUsernameProblemLanguageResultExecution timeMemory
1108998vjudge1Best Place (NOI17_bestplace)C++17
0 / 100
55 ms3120 KiB
#include <bits/stdc++.h> using namespace std; int main (){ int n,m=n,med=0,med1=0; cin>>n; vector<int>v(n); vector<int>s(n); for(int i=0;i<n;++i){ int x,y; cin>>v[x]>>s[y]; } sort(v.begin(),v.end()); sort(s.begin(),s.end()); if(v.size()%2==0){ med=(v[v.size()/2-1]+v[v.size()/2])/2; } else{ med=v[v.size()/2]; } if(s.size()%2==0){ med1=(s[s.size()/2-1]+s[s.size()/2])/2; } else{ med1=s[s.size()/2]; } cout<<med<<" "<<med1; }

Compilation message (stderr)

bestplace.cpp: In function 'int main()':
bestplace.cpp:4:7: warning: unused variable 'm' [-Wunused-variable]
    4 | int n,m=n,med=0,med1=0;
      |       ^
bestplace.cpp:4:7: warning: 'n' is used uninitialized in this function [-Wuninitialized]
    4 | int n,m=n,med=0,med1=0;
      |       ^
bestplace.cpp:10:13: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
   10 |     cin>>v[x]>>s[y];
      |             ^
bestplace.cpp:10:19: warning: 'y' may be used uninitialized in this function [-Wmaybe-uninitialized]
   10 |     cin>>v[x]>>s[y];
      |                   ^
#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...