# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
473582 |
2021-09-15T16:52:09 Z |
Beboo44 |
Doktor (COCI17_doktor) |
C++14 |
|
164 ms |
5104 KB |
#include <bits/stdc++.h>
using namespace std;
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
typedef long long ll;
typedef vector<int> vi;
typedef vector<pair<ll , int> > vpli;
typedef set<char> st;
typedef stack<int> s;
typedef deque<int> dq;
typedef queue<int> q;
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0)
int main()
{
ll n;
cin>>n;
vector<ll>v(n);
for(int i=0; i<n; ++i){
cin>>v[i];
}
ll sum = 1;
ll maxi=0;
ll indx=0;
ll start=0;
for(int i=1; i<n; ++i){
if(v[i]==v[i-1]-1){
++sum;
}
else{
if(sum>maxi){
maxi=sum;
sum=1;
indx=start;
}
start = i;
}
}
if(sum>maxi){
indx = start;
maxi=sum;
}
if(indx<n/2){
cout<<v[indx]<<" "<<v[v[indx]-1];
}
else{
cout<<v[indx+maxi-1]<<" "<<v[indx+maxi-2];
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Failed |
1 ms |
204 KB |
Checker failed - contact admins or jury |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Failed |
0 ms |
204 KB |
Checker failed - contact admins or jury |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't 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 |
Incorrect |
2 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
332 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Failed |
4 ms |
300 KB |
Checker failed - contact admins or jury |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
32 ms |
1500 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Failed |
164 ms |
5104 KB |
Checker failed - contact admins or jury |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
94 ms |
3484 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |