50762023-04-15 07:33:12AncsaLegmesszebbi rossz sorrendű (35 pont)cpp11Wrong answer 0/35300ms4324 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    vector<int> a(n);
    int eleje=0, vege=0,uj;
    for(int i=0;i<n;i++)
    {
        cin>>a.at(i);
        if(a.at(i)<a.at(0))
        {
            vege=i;
        }
    }
    int tav=vege;
    cout<<vege<<endl;
    for(int i=1;i<n-tav;i++)
    {
        for(int j=i+tav+1;j<n;j++)
        {
            cout<<"lepes:"<<i<<" "<<j<<endl;

            if(a.at(j)<a.at(i))
            {
                eleje=i;
                vege=j;
                tav=j-i;
                cout<<eleje<<" "<<vege<<endl;
            }
        }
    }

    cout << eleje+1<<" "<<vege+1 << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/35
1Wrong answer0/03ms1812 KiB
2Time limit exceeded0/0300ms1800 KiB
3Wrong answer0/13ms2328 KiB
4Wrong answer0/13ms2576 KiB
5Wrong answer0/13ms2804 KiB
6Wrong answer0/13ms3044 KiB
7Wrong answer0/13ms3256 KiB
8Time limit exceeded0/1273ms3204 KiB
9Time limit exceeded0/1263ms3388 KiB
10Time limit exceeded0/1252ms3608 KiB
11Time limit exceeded0/1277ms3912 KiB
12Time limit exceeded0/2261ms3236 KiB
13Time limit exceeded0/2233ms3340 KiB
14Time limit exceeded0/2261ms3292 KiB
15Time limit exceeded0/2270ms3492 KiB
16Time limit exceeded0/2254ms3640 KiB
17Time limit exceeded0/2257ms3732 KiB
18Time limit exceeded0/2273ms3884 KiB
19Time limit exceeded0/2240ms3992 KiB
20Time limit exceeded0/2263ms4156 KiB
21Time limit exceeded0/2268ms4032 KiB
22Time limit exceeded0/2252ms4324 KiB
23Time limit exceeded0/2256ms4108 KiB
24Time limit exceeded0/2280ms4136 KiB