60112023-10-18 16:44:35KCsengeInverziócpp14Wrong answer 3/50572ms8332 KiB
#include <iostream>

using namespace std;

int main()
{
    int n,i,j=0;
    cin>>n;
    int tomb[n+1];
    int b=1,jobb=n;
    for(i=1;i<=n;i++)
    {
        cin>>tomb[i];
    }
   if(tomb[b]>tomb[jobb])
        {
            cout<<b<< " "<<n;
            j=1;
        }
    else
    for(i=1;i<n;i++)
    {
        jobb=n-i;
        b=1;
          while(tomb[b]<=tomb[jobb]&&jobb<=n&&j!=1)
         {
             //cout<<i<<" "<<b<<" "<<jobb<<" "<<endl;
           b++;
           jobb++;
           if(tomb[b]>tomb[jobb])
           {
            cout<<b<< " "<<n;
            j=1;
            break;
           }
         }
         if(tomb[b]>tomb[jobb])
           {
            cout<<b<< " "<<jobb;
            j=1;
            break;
           }

    }
    if(j==0)
    cout<<-1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/50
1Accepted0/03ms1876 KiB
2Wrong answer0/0287ms2564 KiB
3Accepted1/12ms2280 KiB
4Accepted2/23ms2500 KiB
5Wrong answer0/73ms2736 KiB
6Wrong answer0/2259ms3416 KiB
7Time limit exceeded0/2566ms4136 KiB
8Wrong answer0/2186ms7228 KiB
9Wrong answer0/2192ms7412 KiB
10Wrong answer0/2186ms7360 KiB
11Wrong answer0/2188ms7576 KiB
12Wrong answer0/2181ms7752 KiB
13Wrong answer0/2186ms8088 KiB
14Wrong answer0/2186ms8296 KiB
15Wrong answer0/2428ms8264 KiB
16Wrong answer0/2186ms8228 KiB
17Wrong answer0/2186ms8104 KiB
18Wrong answer0/2186ms8100 KiB
19Wrong answer0/3419ms8332 KiB
20Time limit exceeded0/3572ms5364 KiB
21Time limit exceeded0/2569ms5576 KiB
22Wrong answer0/2187ms8324 KiB
23Wrong answer0/2186ms8312 KiB
24Time limit exceeded0/2549ms5700 KiB