62722023-11-11 12:30:09MrChipserLegmesszebbi rossz sorrendű (35 pont)cpp11Wrong answer 0/35300ms12708 KiB
#include <iostream>

using namespace std;
int a[100000];
int main()
{
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
        cin >> a[i];
    int b[n];
    for(int i = 0; i < n;i++)
        b[i]=i;
    int sz = 1;
    while(sz!=0)
    {
        sz=0;
        for(int i = 0; i <n-1; i++)
        {
            if(a[i]>a[i+1])
            {
                int temp = a[i];
                a[i]=a[i+1];
                a[i+1]=temp;
                temp = b[i];
                b[i]=b[i+1];
                b[i+1]=temp;
                sz++;
                cout << a[i] << " " << a[i+1] << endl;
            }
        }
    }
    int minim = 100000;
    for(int i = 0; i < n; i++)
        cout << b[i]+1 << " ";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/35
1Wrong answer0/03ms1880 KiB
2Time limit exceeded0/0300ms2744 KiB
3Wrong answer0/13ms2968 KiB
4Wrong answer0/13ms3208 KiB
5Wrong answer0/13ms3440 KiB
6Wrong answer0/12ms3536 KiB
7Wrong answer0/14ms3664 KiB
8Wrong answer0/135ms3856 KiB
9Wrong answer0/178ms3780 KiB
10Wrong answer0/170ms3812 KiB
11Wrong answer0/192ms4108 KiB
12Time limit exceeded0/2259ms3740 KiB
13Time limit exceeded0/2250ms4424 KiB
14Time limit exceeded0/2238ms4740 KiB
15Time limit exceeded0/2266ms4840 KiB
16Time limit exceeded0/2254ms5348 KiB
17Time limit exceeded0/2266ms6180 KiB
18Time limit exceeded0/2254ms6920 KiB
19Time limit exceeded0/2261ms7780 KiB
20Time limit exceeded0/2266ms8564 KiB
21Time limit exceeded0/2261ms9356 KiB
22Time limit exceeded0/2275ms10024 KiB
23Wrong answer0/246ms12168 KiB
24Wrong answer0/246ms12708 KiB