제출 #293168

#제출 시각아이디문제언어결과실행 시간메모리
293168BertedBest Place (NOI17_bestplace)C++14
100 / 100
196 ms4192 KiB
#include <iostream> #include <vector> #include <algorithm> #define pub push_back #define ll long long using namespace std; const ll inft = 10000000000; vector<ll> x,y; ll as (ll n) {if (n<0) {return -n;} else {return n;}} ll medianx() { if (x.size()%2) {return x[x.size()/2];} else {return (x[x.size()/2-1] + x[x.size()/2])/2;} } ll mediany() { if (y.size()%2) {return y[y.size()/2];} else {return (y[y.size()/2-1] + y[y.size()/2])/2;} } int main() { ll n,xt=0,yt=0,xmn=inft,ymn=inft,xmx=-1,ymx=-1,xrmin=inft,yrmin=inft,xrminr = inft,yrminr = inft; cin>>n; for (ll i=0;i<n;i++) { ll tx,ty;cin>>tx>>ty; xt+=tx;yt+=ty; xmx = max(xmx,tx);ymx = max(ymx,ty); xmn = min(xmn,tx);ymn = min(ymn,ty); x.pub(tx);y.pub(ty); } sort(x.begin(),x.end());sort(y.begin(),y.end()); cout<<medianx()<<" "<<mediany()<<"\n"; }

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

bestplace.cpp: In function 'int main()':
bestplace.cpp:22:52: warning: unused variable 'xrmin' [-Wunused-variable]
   22 |     ll n,xt=0,yt=0,xmn=inft,ymn=inft,xmx=-1,ymx=-1,xrmin=inft,yrmin=inft,xrminr = inft,yrminr = inft;
      |                                                    ^~~~~
bestplace.cpp:22:63: warning: unused variable 'yrmin' [-Wunused-variable]
   22 |     ll n,xt=0,yt=0,xmn=inft,ymn=inft,xmx=-1,ymx=-1,xrmin=inft,yrmin=inft,xrminr = inft,yrminr = inft;
      |                                                               ^~~~~
bestplace.cpp:22:74: warning: unused variable 'xrminr' [-Wunused-variable]
   22 |     ll n,xt=0,yt=0,xmn=inft,ymn=inft,xmx=-1,ymx=-1,xrmin=inft,yrmin=inft,xrminr = inft,yrminr = inft;
      |                                                                          ^~~~~~
bestplace.cpp:22:88: warning: unused variable 'yrminr' [-Wunused-variable]
   22 |     ll n,xt=0,yt=0,xmn=inft,ymn=inft,xmx=-1,ymx=-1,xrmin=inft,yrmin=inft,xrminr = inft,yrminr = inft;
      |                                                                                        ^~~~~~
#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...