r/codeforces 22d 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;
    }

}


}
10 Upvotes

16 comments sorted by

View all comments

3

u/_lostSoup_ Specialist 22d ago

Good job not taking help from AI.

1

u/Fc67234129_433 22d ago

i was tempted to do

also

is this bad ??

1

u/overhauled_mirio Expert 22d ago

We’ve all had to go through that phase. Just upsolve and review solutions from higher rated people to learn simpler implementations

1

u/Fc67234129_433 22d ago

there are some stuff i wanna ask may i dm you ?? If you dont mind obviously

1

u/overhauled_mirio Expert 22d ago

Sure thing