60062023-10-18 16:10:38Tina0731Inverziócpp14Wrong answer 3/50185ms68184 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int t[n+1];
    for(int i=1;i<=n;i++)
    cin>>t[i];

    int h=n;
    int jobb, bal;
    while(h>1)
    {
        jobb=h;
        bal=1;
        if(t[bal]>t[jobb])
        {
            cout<<bal<<" "<<jobb;
            return 0;
        }
        while(jobb+h<=n)
        {
            //cout<<"xx";
            bal+=h;
            jobb+=h;
            if(t[jobb]>t[bal])
            {
                cout<<jobb<<" "<<bal;
                return 0;
            }
        }

        h--;
    }
    cout<<-1;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/50
1Accepted0/03ms2152 KiB
2Wrong answer0/017ms2896 KiB
3Accepted1/13ms2628 KiB
4Accepted2/23ms2844 KiB
5Wrong answer0/73ms3020 KiB
6Wrong answer0/217ms3856 KiB
7Wrong answer0/2174ms10860 KiB
8Wrong answer0/2175ms14532 KiB
9Wrong answer0/2175ms17940 KiB
10Wrong answer0/2174ms21352 KiB
11Wrong answer0/2178ms24684 KiB
12Wrong answer0/2177ms27840 KiB
13Wrong answer0/2174ms31252 KiB
14Wrong answer0/2174ms34564 KiB
15Wrong answer0/2178ms38136 KiB
16Wrong answer0/2174ms41668 KiB
17Wrong answer0/2174ms45076 KiB
18Wrong answer0/2174ms48496 KiB
19Wrong answer0/3177ms51740 KiB
20Wrong answer0/3185ms55044 KiB
21Wrong answer0/2175ms58356 KiB
22Wrong answer0/2174ms61564 KiB
23Wrong answer0/2174ms64876 KiB
24Wrong answer0/2174ms68184 KiB