42792023-03-21 16:01:20Tibi23A lehető legkevesebb átszállás (50 pont)cpp11Wrong answer 2/50300ms4520 KiB
#include <iostream>
#include <vector>
#include <algorithm>


using namespace std;



    int main()
{
    int N;
    cin>>N;
    int szamok[N];
    for(int i=0; i<N; i++){
        cin>>szamok[i];
    }
    int db=0;

    sort(szamok,szamok+N);
    do {
        cout<<"-";
        bool hiba = false;
        bool csokken = true;
        for(int i=1; i<N; i++){
            if (szamok[i]>szamok[i-1]){
                if(csokken==true)
                    csokken=false;

            }
            if(szamok[i]<szamok[i-1] && csokken==false)
            {
                hiba=true;
                break;
            }
        }

        if(hiba==false){
               db=(db+1)%1000000007;
                cout<<db<<endl;

        }



       /* for(int i=0; i<N; i++){
            cout<<szamok[i]<<" ";
        }
        cout<<endl;*/

    } while ( std::next_permutation(szamok,szamok+N) );
    cout<<db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/50
1Wrong answer0/03ms1876 KiB
2Time limit exceeded0/0300ms2256 KiB
3Accepted1/13ms2396 KiB
4Accepted1/13ms2608 KiB
5Wrong answer0/22ms2696 KiB
6Wrong answer0/23ms2944 KiB
7Time limit exceeded0/2273ms2936 KiB
8Time limit exceeded0/2259ms3008 KiB
9Time limit exceeded0/2239ms2292 KiB
10Time limit exceeded0/2263ms3316 KiB
11Time limit exceeded0/2268ms3324 KiB
12Time limit exceeded0/2263ms3576 KiB
13Time limit exceeded0/2275ms3752 KiB
14Time limit exceeded0/2256ms3732 KiB
15Time limit exceeded0/2275ms3848 KiB
16Time limit exceeded0/2275ms3876 KiB
17Time limit exceeded0/2263ms3976 KiB
18Time limit exceeded0/2270ms4132 KiB
19Time limit exceeded0/2263ms4080 KiB
20Time limit exceeded0/2287ms4248 KiB
21Time limit exceeded0/2270ms4104 KiB
22Time limit exceeded0/2250ms4116 KiB
23Time limit exceeded0/2247ms4320 KiB
24Time limit exceeded0/2254ms4308 KiB
25Time limit exceeded0/2256ms4520 KiB
26Time limit exceeded0/2224ms4508 KiB
27Time limit exceeded0/2259ms3640 KiB
28Time limit exceeded0/2275ms3732 KiB