# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
473153 | 2021-09-15T09:27:52 Z | MamdouhN | Doktor (COCI17_doktor) | C++17 | 559 ms | 37444 KB |
#include<bits/stdc++.h> using namespace std; #define int long long #define endl "\n" map<pair<int,int>,int>idk; main() { int n; cin>>n; int ar[n]; for(int i=0;i<n;i++) { cin>>ar[i]; int x = min(ar[i]-1,i); int y = max(ar[i]-1,i); int dist = min(x - 0 , n - y-1); idk[{ x-dist , y+dist }]++; } int x = 0; pair<int,int>ans; for(auto v:idk) { if(v.second>x) { x = v.second; ans = v.first; } } cout<<ar[ans.first]<<" "<<ar[ans.second]<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 460 KB | Output is correct |
2 | Correct | 2 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 204 KB | Output is correct |
2 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 716 KB | Output is correct |
2 | Correct | 104 ms | 4524 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 62 ms | 5084 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 559 ms | 26696 KB | Output is correct |
2 | Correct | 173 ms | 7492 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 271 ms | 16000 KB | Output is correct |
2 | Correct | 327 ms | 37444 KB | Output is correct |