175642025-07-21 11:58:25szjInverziócpp17Wrong answer 0/50185ms2356 KiB
#include <iostream>
using namespace std;
int main()
{
    int n, a, i, ma, ml = -1, k, v;
    cin >> n;
    int t[n];
    for(i=0; i<n; i++)
    {
        cin >> a;
        t[a-1] = i;
    }
    for(i=0; i<n; i++)
    {
        if(t[i] > ma) ma = t[i];
        if(ma - t[i] > ml)
        {
            ml = ma - t[i];
            k = ma;
            v = t[i];
        }
    }
    if(ml == -1) cout << -1;
    return 0;
    cout << v+1 << " " << k+1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms316 KiB
2Wrong answer0/017ms532 KiB
3Wrong answer0/11ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/71ms316 KiB
6Wrong answer0/217ms484 KiB
7Wrong answer0/2172ms2324 KiB
8Wrong answer0/2179ms2092 KiB
9Wrong answer0/2180ms2100 KiB
10Wrong answer0/2175ms2228 KiB
11Wrong answer0/2174ms2100 KiB
12Wrong answer0/2185ms2100 KiB
13Wrong answer0/2174ms2100 KiB
14Wrong answer0/2174ms2156 KiB
15Wrong answer0/2172ms2356 KiB
16Wrong answer0/2177ms2100 KiB
17Wrong answer0/2174ms2100 KiB
18Wrong answer0/2174ms2152 KiB
19Wrong answer0/3172ms2188 KiB
20Wrong answer0/3172ms2168 KiB
21Wrong answer0/2172ms2288 KiB
22Wrong answer0/2175ms2108 KiB
23Wrong answer0/2174ms2348 KiB
24Wrong answer0/2172ms2100 KiB