67342023-12-18 12:26:53madvirInverziócpp17Wrong answer 3/50180ms8116 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, tav=0, e, u;
    cin >> n;
    int a[n];
    cin >> a[0];
    for(int i=1; i<n; i++) {
        cin >> a[i];
        if(a[i]<a[i-1]) {
            if(a[i-1]-a[i]>tav) {
                tav=a[i-1]-a[i];
                e=a[i];
                u=a[i-1];
            }
        }
    }

    if(tav==0) {
        cout << -1;
    }
    else {
        cout << e << " " << u;
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/50
1Accepted0/03ms1744 KiB
2Wrong answer0/017ms2452 KiB
3Accepted1/13ms2352 KiB
4Wrong answer0/23ms2520 KiB
5Wrong answer0/73ms2640 KiB
6Wrong answer0/218ms3448 KiB
7Wrong answer0/2173ms7000 KiB
8Wrong answer0/2175ms7004 KiB
9Wrong answer0/2174ms7084 KiB
10Wrong answer0/2177ms7100 KiB
11Wrong answer0/2174ms7100 KiB
12Wrong answer0/2180ms7348 KiB
13Wrong answer0/2177ms7564 KiB
14Wrong answer0/2175ms7644 KiB
15Wrong answer0/2173ms7780 KiB
16Wrong answer0/2175ms7856 KiB
17Wrong answer0/2175ms8048 KiB
18Wrong answer0/2174ms8116 KiB
19Wrong answer0/3173ms7996 KiB
20Wrong answer0/3175ms7996 KiB
21Wrong answer0/2177ms7996 KiB
22Wrong answer0/2174ms7996 KiB
23Wrong answer0/2174ms7996 KiB
24Accepted2/2171ms7996 KiB