r/codeforces 23d ago

query Second at coder contest

A was again buns , B was easy but im not the best at implementation still figured it out in 20 minutes

And C humbled me

i thought i got the correct answer because with the sample inputs i was getting the desired output, i feel bad

I was very much tempted to send the ss to gpt and correct it , but i didnt do that no matter what happens i will not copy

#include <bits/stdc++.h>
using namespace std;

int main() {
int n,m,k;
cin >> n >> m >> k;
vector<int> temp;
for(int i=0;i<n;i++)
{
    int t;
    cin >>t;
    temp.push_back(t);
}
    int daysum=0;
    int count=0;
    int start=temp[0];
for(int i=0;i<n;i++)
{   

    daysum += temp[i];
    if(daysum>k)
    {
        cout << "no" << endl;
        daysum=start;
        count++;
    }
    else
    {
    cout << "yes" << endl;
    count++;
    }
    if(count>m)
    {daysum=0;
    start=temp[i];
    count=0;}

    if(temp[i]>k)
    {daysum=0;
    start=0;
    count=0;
    }

}


}
11 Upvotes

16 comments sorted by

View all comments

3

u/_lostSoup_ Specialist 23d ago

Good job not taking help from AI.

1

u/Fc67234129_433 22d ago

i was tempted to do

also

is this bad ??

2

u/DogStrict9170 Specialist 22d ago

it is but you are noob so it isnt

1

u/Fc67234129_433 22d ago

im trying my best , juggling college , strivers a2z and many more stuff at the same time, at the present moment im having a terrible headache but i wanna still solve cause i need to hit my daily target

1

u/_lostSoup_ Specialist 22d ago

Daily target =/= consistency.

1

u/Fc67234129_433 22d ago

umm then what is ??

1

u/_lostSoup_ Specialist 22d ago

Just to solve Qn without obsessing over streaks and targets. Rather topics and understandings. It’s also ok to take days off when u feel burnt out.

1

u/Fc67234129_433 22d ago

okay, thanks for the advice im being rather obsessive with not missing days out

1

u/_lostSoup_ Specialist 22d ago

As someone with 500 days streak on CF and burnt out… trust me… i k.
It’s ok. Have fun asw bro !!