Submission #473175

# Submission time Handle Problem Language Result Execution time Memory
473175 2021-09-15T09:47:41 Z Ahmed_Solyman Doktor (COCI17_doktor) C++14
0 / 100
1000 ms 4044 KB
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);      cout.tie(0);
    ll n;cin>>n;
    vector<ll>arr(n);
    for(auto &i:arr)cin>>i;
    int x=1,y=1;
    int mx=0;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            reverse(arr.begin()+i,arr.begin()+j+1);
            ll cnt=0;
            for(ll k=i;k<=j;k++){
                cnt+=(arr[k]==k+1);
            }
            if(cnt>mx){
                x=arr[i];y=arr[j];
                mx=cnt;
            }
            reverse(arr.begin()+i,arr.begin()+j+1);
        }
    }
    cout<<arr[x]<<" "<<arr[y]<<endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Failed 14 ms 312 KB Checker failed - contact admins or jury
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1097 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1084 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1087 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1071 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1090 ms 972 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1090 ms 4044 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1079 ms 2508 KB Time limit exceeded
2 Halted 0 ms 0 KB -