93972024-02-21 12:36:38KristófLeghosszabb nyaralás (75 pont)cpp17Time limit exceeded 28/75300ms3404 KiB
#include <iostream>
#include <vector>
struct penz{
    int budget;
    int nap;
} typedef;

using namespace std;

int main()
{
    int n , p;
    cin>>n>>p;
    int num;
    vector <penz> napok;
    for(int i=0;i<n;i++)
    {
        cin>>num;
        napok.push_back({num,1});
        for(int j=0;j<napok.size()-1;j++)
        {
            if(napok[j].budget<p+1)
                {
                    napok[j].budget+=num;
                    napok[j].nap+=1;
                }
        }
    }
    int max=INT8_MIN;
    for(int i=0;i<n;i++)
        {
            if(napok[i].nap-1>max)
                {
                max=napok[i].nap-1;
                }
        }
    cout<<max;



    return 0;
}
SubtaskSumTestVerdictTimeMemory
base28/75
1Accepted0/03ms1808 KiB
2Time limit exceeded0/0300ms1728 KiB
3Accepted3/33ms2212 KiB
4Wrong answer0/33ms2412 KiB
5Accepted3/33ms2640 KiB
6Wrong answer0/33ms2600 KiB
7Accepted3/33ms2844 KiB
8Wrong answer0/43ms3068 KiB
9Accepted4/43ms2900 KiB
10Accepted5/53ms3028 KiB
11Accepted5/563ms3396 KiB
12Accepted5/559ms3404 KiB
13Time limit exceeded0/7261ms2772 KiB
14Time limit exceeded0/7264ms2776 KiB
15Time limit exceeded0/7231ms2964 KiB
16Time limit exceeded0/8266ms3160 KiB
17Time limit exceeded0/8256ms3160 KiB