184432025-10-22 18:39:43algoproInverziócpp17Wrong answer 5/50181ms560 KiB
// UUID: b05e4d6b-ca4e-45ec-8187-3404cb10d15c
#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    int S;
    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/01ms500 KiB
2Wrong answer0/017ms508 KiB
3Accepted1/11ms316 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/71ms400 KiB
6Wrong answer0/217ms536 KiB
7Wrong answer0/2178ms396 KiB
8Wrong answer0/2178ms400 KiB
9Wrong answer0/2179ms396 KiB
10Wrong answer0/2178ms408 KiB
11Wrong answer0/2178ms328 KiB
12Wrong answer0/2174ms400 KiB
13Wrong answer0/2179ms392 KiB
14Wrong answer0/2178ms400 KiB
15Wrong answer0/2179ms396 KiB
16Wrong answer0/2179ms512 KiB
17Wrong answer0/2179ms316 KiB
18Wrong answer0/2181ms392 KiB
19Wrong answer0/3180ms392 KiB
20Wrong answer0/3179ms316 KiB
21Wrong answer0/2179ms396 KiB
22Wrong answer0/2178ms316 KiB
23Wrong answer0/2179ms560 KiB
24Accepted2/2179ms400 KiB