Submission #932827

#TimeUsernameProblemLanguageResultExecution timeMemory
932827ishat_jhaBest Place (NOI17_bestplace)C++14
23 / 100
91 ms2016 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ff first #define ss second void solvr() { ll n; cin >> n; vector<pair<ll, ll>> v(n); for(ll i = 0; i < n; i++) { cin >> v[i].ff >> v[i].ss; } if(n == 2) { cout << v[0].ff << " " << v[0].ss << endl; return; } ll tt = 0; ll minn = LLONG_MAX; for(ll i = 0; i < 1000; i++) { ll sum = 0; for(ll j = 0; j < n; j++) { sum += abs(v[j].ff - i); } if(minn > sum) { tt = i; minn = sum; } } cout << tt << " " << 0 << endl; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long int t = 1; //cin >> t; while(t--) { solvr(); } }
#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...