155452025-02-20 11:49:52MrkzTűzijátékcpp17Time limit exceeded 0/50400ms2296 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;i++){
        St[szint]=i;
        if(Jo(szint))
            Back(szint+1);
    }
}
int main()
{
    beolvas();Back(1);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/01ms316 KiB
2Time limit exceeded0/0384ms2104 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Time limit exceeded0/2400ms316 KiB
9Time limit exceeded0/2398ms512 KiB
10Time limit exceeded0/2400ms560 KiB
11Time limit exceeded0/2384ms564 KiB
12Time limit exceeded0/2391ms564 KiB
13Time limit exceeded0/2389ms912 KiB
14Time limit exceeded0/2391ms744 KiB
15Time limit exceeded0/3388ms564 KiB
16Time limit exceeded0/3381ms1004 KiB
17Time limit exceeded0/3381ms1140 KiB
18Time limit exceeded0/3382ms1332 KiB
19Time limit exceeded0/3379ms2296 KiB
20Time limit exceeded0/3375ms2104 KiB
21Time limit exceeded0/4375ms2232 KiB
22Time limit exceeded0/4375ms2104 KiB