Submission #166013

#TimeUsernameProblemLanguageResultExecution timeMemory
166013theStaticMindDoktor (COCI17_doktor)C++14
70 / 100
500 ms37628 KiB
#include<bits/stdc++.h> #define mp make_pair #define pb push_back #define ii pair<int,int> #define all(x) (x).begin(),(x).end() #define INF 100000000000000000 #define modulo 1000000007 #define mod 998244353 #define int long long int using namespace std; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); // freopen("q.gir","r",stdin); // freopen("q.cik","w",stdout); int n; cin>>n; vector<int> arr(n+1); for(int i=1;i<=n;i++)cin>>arr[i]; map<double,int>data; for(int i=1;i<=n;i++){ data[(double)(arr[i]+i)/2.0]++; } double mx=0; int cnt=0; for(map<double,int>::iterator itr=data.begin();itr!=data.end();itr++){ if(itr->second>cnt){ cnt=itr->second; mx=itr->first; } } int l= mx-min(n-mx,mx-1),r=mx+min(n-mx,mx-1); cout<<arr[l]<<" "<<arr[r]; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...