51242023-04-18 16:53:15KCsengeLegmesszebbi rossz sorrendű (35 pont)cpp14Wrong answer 1/35214ms6544 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

/*
10
7 2 4 17 6 5 10 10 18 19
*/
int main()
{
    long long int i,n,s=0,e,m,elso, masodik,maxr,hanyadik;
    cin>>n;
    long long int tomb[n];
    cin>>tomb[0];

    for(i=1; i<n;i++)
    {
        cin>>tomb[i];
        if(tomb[0]>tomb[i])
        {
            hanyadik=i;
            e=0;
            m=i;
        }
    }
    s=hanyadik;
   // cout<<s<<endl;

   int t=tomb[0];
    for(i=1;i<n-1;i++)
    {
       if(t>tomb[i])
        {
            for(long long j=n-1;j>=i+s;j--)
        {
            if(tomb[i]>tomb[j])
            {
                elso=i;
                masodik=j;
                maxr=masodik-elso;
                if(maxr>s)
                {
                    e=i;
                    m=j;
                    s=maxr;
                }
                break;
            }
        }
        }
    }

   // cout <<s<<endl;
   if(s==0)
    cout<<-1;
   else
    cout<<e+1<<" "<<m+1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base1/35
1Accepted0/03ms2024 KiB
2Wrong answer0/086ms3540 KiB
3Wrong answer0/13ms2180 KiB
4Accepted1/13ms2436 KiB
5Wrong answer0/13ms2648 KiB
6Wrong answer0/13ms2856 KiB
7Wrong answer0/13ms3048 KiB
8Wrong answer0/13ms3160 KiB
9Wrong answer0/13ms3104 KiB
10Wrong answer0/14ms3348 KiB
11Wrong answer0/14ms3696 KiB
12Wrong answer0/217ms4444 KiB
13Wrong answer0/218ms4444 KiB
14Wrong answer0/219ms4468 KiB
15Wrong answer0/214ms4452 KiB
16Wrong answer0/220ms4844 KiB
17Wrong answer0/241ms5368 KiB
18Wrong answer0/256ms5492 KiB
19Wrong answer0/2155ms5960 KiB
20Time limit exceeded0/2214ms6024 KiB
21Wrong answer0/243ms6096 KiB
22Wrong answer0/2107ms6136 KiB
23Wrong answer0/235ms6128 KiB
24Wrong answer0/235ms6544 KiB