184422025-10-22 18:38:52algoproInverziócpp17Wrong answer 5/50178ms4340 KiB
// UUID: 214aa07c-6b9d-4ae4-a3fc-e3ad367a4049
#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;
        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/017ms760 KiB
3Accepted1/11ms316 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/71ms316 KiB
6Wrong answer0/217ms564 KiB
7Wrong answer0/2174ms4332 KiB
8Wrong answer0/2174ms4328 KiB
9Wrong answer0/2178ms4148 KiB
10Wrong answer0/2175ms4148 KiB
11Wrong answer0/2175ms4328 KiB
12Wrong answer0/2172ms4252 KiB
13Wrong answer0/2177ms4328 KiB
14Wrong answer0/2175ms4324 KiB
15Wrong answer0/2175ms4324 KiB
16Wrong answer0/2175ms4196 KiB
17Wrong answer0/2177ms4332 KiB
18Wrong answer0/2174ms4324 KiB
19Wrong answer0/3177ms4148 KiB
20Wrong answer0/3175ms4148 KiB
21Wrong answer0/2174ms4148 KiB
22Wrong answer0/2175ms4148 KiB
23Wrong answer0/2175ms4340 KiB
24Accepted2/2175ms4148 KiB