184412025-10-22 18:38:23algoproInverziócpp17Wrong answer 5/50194ms4340 KiB
// UUID: 54a2211e-383a-4ad4-8657-4b8d00b174e3
#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> sor(N+1);
    sor[0] = 0;
    int S;
    vector<int> index(N+1);
    index[0] = 0;
    int max = 0;
    int tav = 0;
    for (int i = 1; i < N+1; i++){
        cin >> S;
        sor[i] = S;
        index[S] = i;
        if (S > max){
            max = S;
        }   else {
            tav = max - 1;
        }
    }
    if (tav == 0){
        cout << -1;
    }   else {
        cout << max-tav << " " << max;
    }
   
}
SubtaskSumTestVerdictTimeMemory
base5/50
1Accepted0/01ms316 KiB
2Wrong answer0/017ms564 KiB
3Accepted1/11ms328 KiB
4Accepted2/21ms508 KiB
5Wrong answer0/71ms316 KiB
6Wrong answer0/217ms564 KiB
7Wrong answer0/2184ms4324 KiB
8Wrong answer0/2194ms4148 KiB
9Wrong answer0/2189ms4200 KiB
10Wrong answer0/2193ms4340 KiB
11Wrong answer0/2190ms4148 KiB
12Wrong answer0/2185ms4148 KiB
13Wrong answer0/2188ms4148 KiB
14Wrong answer0/2187ms4328 KiB
15Wrong answer0/2185ms4152 KiB
16Wrong answer0/2189ms4148 KiB
17Wrong answer0/2187ms4148 KiB
18Wrong answer0/2187ms4148 KiB
19Wrong answer0/3182ms4328 KiB
20Wrong answer0/3184ms4328 KiB
21Wrong answer0/2182ms4148 KiB
22Wrong answer0/2189ms4148 KiB
23Wrong answer0/2187ms4148 KiB
24Accepted2/2182ms4332 KiB