155472025-02-20 11:53:10MrkzTűzijátékcpp17Time limit exceeded 0/50400ms2228 KiB
#include <bits/stdc++.h>
using namespace std;
vector<long long> Tav;
vector<long long> eredeti;
vector<int> St;
int T,N,S;
bool b=true;
void beolvas(){
    cin>>N>>S>>T;
    Tav.resize(N+1);
    eredeti.resize(N+1);
    St.resize(S+1);
    for(int i=1;i<=N;i++){
        cin>>Tav[i];
        eredeti[i]=Tav[i];
    }
    //sort(Tav.begin(), Tav,end());
}
void Mutat(int szint){
    cout<<szint-1<<endl;
    for(int i=1;i<szint;i++)
        cout<<St[i]<<" ";
    cout<<endl;
}
bool vanMegoldas(int szint){
    return (szint==S && b==true);
}
bool Jo(int szint){
    if(szint==1)
        return true;
    for(int i=1;i<szint;i++)
        if(St[i]>=St[szint] || Tav[St[i]]+100>Tav[St[szint]])
            return false;
    return true;
}
void Back(int szint){
    if(vanMegoldas(szint-1)){
        Mutat(szint);
        b=false;
    }
    else for(int i=1;i<=N && b==true;i++){
        St[szint]=i;
        if(Jo(szint))
            Back(szint+1);
    }
}
int main()
{
    beolvas();Back(1);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/01ms512 KiB
2Time limit exceeded0/0377ms2100 KiB
3Wrong answer0/21ms508 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Time limit exceeded0/2398ms316 KiB
9Time limit exceeded0/2400ms744 KiB
10Time limit exceeded0/2398ms556 KiB
11Time limit exceeded0/2381ms756 KiB
12Time limit exceeded0/2365ms568 KiB
13Time limit exceeded0/2367ms564 KiB
14Time limit exceeded0/2367ms756 KiB
15Time limit exceeded0/3381ms564 KiB
16Time limit exceeded0/3391ms820 KiB
17Time limit exceeded0/3393ms1080 KiB
18Time limit exceeded0/3391ms1348 KiB
19Time limit exceeded0/3388ms2100 KiB
20Time limit exceeded0/3386ms2100 KiB
21Time limit exceeded0/4388ms2228 KiB
22Time limit exceeded0/4388ms2100 KiB