51212023-04-18 16:25:22KCsengeLegmesszebbi rossz sorrendű (35 pont)cpp14Time limit exceeded 8/35300ms4352 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;
    cin>>n;
    long long int tomb[n];
    for(i=0; i<n;i++)
    cin>>tomb[i];

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

    //cout <<maxr<<endl;
    cout<<e+1<<" "<<m+1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base8/35
1Accepted0/03ms1748 KiB
2Time limit exceeded0/0300ms1972 KiB
3Wrong answer0/13ms2152 KiB
4Accepted1/13ms2368 KiB
5Accepted1/13ms2556 KiB
6Accepted1/12ms2644 KiB
7Accepted1/13ms2640 KiB
8Accepted1/13ms2868 KiB
9Accepted1/14ms2964 KiB
10Accepted1/16ms3204 KiB
11Accepted1/18ms3304 KiB
12Time limit exceeded0/2300ms3028 KiB
13Time limit exceeded0/2264ms3296 KiB
14Time limit exceeded0/2256ms3092 KiB
15Time limit exceeded0/2230ms4292 KiB
16Time limit exceeded0/2279ms3484 KiB
17Time limit exceeded0/2266ms3856 KiB
18Time limit exceeded0/2266ms3780 KiB
19Time limit exceeded0/2263ms3912 KiB
20Time limit exceeded0/2252ms4004 KiB
21Time limit exceeded0/2275ms4076 KiB
22Time limit exceeded0/2252ms4324 KiB
23Time limit exceeded0/2236ms4304 KiB
24Time limit exceeded0/2239ms4352 KiB