Submission #166013

# Submission time Handle Problem Language Result Execution time Memory
166013 2019-11-30T07:46:02 Z theStaticMind Doktor (COCI17_doktor) C++14
70 / 100
500 ms 37628 KB
#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 time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 632 KB Output is correct
2 Correct 3 ms 548 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 888 KB Output is correct
2 Correct 39 ms 4648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 51 ms 5656 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 500 ms 30056 KB Output is correct
2 Correct 80 ms 7548 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 255 ms 17784 KB Output is correct
2 Correct 253 ms 37628 KB Output is correct