Need some help

My code works correctly but i dont get right answer , i think it is the problem with the subtasks

@pruthil Where is your code? which problem? If you have any problem to understanding Problems(All problem except ongoing contest problems) then you can post your topic in CodeChef Discuss and there are many great programmer here to help you.

Actually it is an ongoing contest question

Then think of edge case instead of asking here and there.

i am not asking for solution

@pruthil In that case, you should wait for contest end and you can see editorial after the contest end and you can also post your problem when the contest end. So try to solve the problem and if you get WA or TLE again and again then don’t worry. Keep your solution for ask about the problem of your solution after the contest end. :grin:

Okay you are saying problem lie with subtask.
No bro it isn’t, see the number of successful submission in this problem.

Yes

It doesn’t. my code works even after asserting all the constraints, including the constraints of each subtask.

actually i have just started coding on the platform so i dont know much about it, i have solved the prolem and it also provides required output yet it is not accepted

You might want to look at the constraints or reread the question then. The questions are first made by the setter, usually 6 stars and above. They then go through the codechef panel to check the validity of the answer. Then the question is given to a tester who has to try all the problems and solve them without external help. And then the editorialist has to write and explain each step in sufficient detail. The translators then make sure the question can be understood correctly. I promise, the questions set by codechef are always correct.

1 Like

In every problem there are some edge case ,your code is only giving correct output for given test case not for all hidden test case.
That’s why you are getting WA verdict.

i am not doubting them

Yes i am getting WA

Not always (see e.g. the announcement for CHEFRAN), but any mistakes are usually found and fixed pretty quickly.

3 Likes

Irrelevant, but I was looking through your submissions, to see if you got chefran wrong because of that, and saw that all your code is very detailed, and has lot of extra features. If you could make a post detailing all of those features you use and that would be very helpful to a lot of people.
I mean something like this : CodeChef: Practical coding for everyone
If you don’t have the time to explain how you make such detailed code it’s okay.
My codes are practically impossible to debug for me because they end up looking like this.
CodeChef: Practical coding for everyone

2 Likes

That’s very kind of you to say, but my MDSWIN “solution” is a long, sprawling mess that didn’t even get 100 pts :slight_smile:

Which bits do you think would be helpful for people?

1 Like

The main difference I meant was it is easy to see in your code what everything means and very easy to see what your code is actually doing with your debugging methods. I understand it’s long, but how do you make it neat and understandable? I think debugging would be alot easier for you since you can see what your code is doing. Whereas I struggle to figure out what my own code is doing.

2 Likes

Hmmm … hard to offer general advice on this, I’m afraid: the best I can do is probably refer you to this post :frowning:

2 Likes

It’s okay. My only knowledge of c++ is my school courses, and little of what I’ve learnt from looking at other’s code, so maybe that’s why I’m not able to make codes that good. But at least I’ve learnt #if, assert, and debugging headers from you, so thanks for that.

2 Likes