Not Enough Time for MATHL problem in Biteration #2 (Rated for Div. 2)

The MATHL problem had very weird Test Cases for the Original Task, i.e. the 2nd subtask I think, because my O(n) solution in C++ gave me TLE. Here’s my solution: CodeChef: Practical coding for everyone
It should’ve passed I think :confused: , but I guess the solution needed some further micro optimizations,and those kinds of problems are really frustrating :worried:

3 Likes

https://www.codechef.com/viewsolution/26690528

Don’t use endl (:

1 Like

wat the hecc br0 :frowning: This isn’t fair :((((((((((( :3

1 Like

True that, but as I said, micro-optimizations can get really frustrating during short contests. It’s pointless to keep these kind of test cases if it’s an algo test, that too based on a maths problem one.

Hey, I kept submitting problems for 1 hour and Codechef said:- “Sorry, undefined…too much load” . And I got (6-7) false penalties due to this. Lastly, after being wrecked for 1 hour, I left the contest.

Can I complain about it somewhere? @nagpaljatin141

PS:- I realized that their were no penalties for WA’s.

The first sub-task should have passed with brute-force(according to calculations of time complexity?), but it didn’t! Only efficient solution is working for both sub-tasks :slight_smile:

“false penalties” :thinking:
What do u mean by false penalties here?, since the Judging Criteria clearly mentions, that there are no penalties for incorrect submissions.

Ok, so I got no penalties…But I submitted first question for half hour and second question for half-hour…all that time wasted …what about that ? Its outright unfair!!
I should have got AC as soon as I submit, but Codechef took half hour+half-hour(they kept saying, too much load, submit-later) :frowning:

Whenever they say:-submit later, they don’t show it on profile, that they weren’t able to judge the solution!

I’d say the problem didn’t involve Micro-optimizations, since Flushing an output 10^6 times is far different from flushing it at the end, just imagine, you want to drink water 10^6 times in a day(a sip each time), would u each time go the well situated outside ur house to drink water each time?, or you’d store it in a bottle worth 10^6 sips and keep it near you so that u can drink whenever u want in no time?. Same is the situation here.

2 Likes

Anyways, I think server load is not in your control…

I think that error is because of slow or no internet
Codechef do not reject solutions in case of heavy load imo and afaik

1 Like

But I have good internet connection :frowning:

Others also faced this problem…yesterday Codechef wasnt able to handle all the submissions I guess :frowning:

Problems are good ! But very hard to submit !!!

1 Like

But they delay it ! They say submit later ! Maybe it was my bad luck!!

1 Like

I don’t think avoiding endl is very rare or micro optimization. It a very general optimization.
You can take it positively that now you know endl is slow and it should be avoided as much as possible. Use “\n” instead unless its an interactive problem.

2 Likes

It might take time in running solution but generally it accepts solution when we submit.

They don’t do that afaik.

true true i agree :slight_smile:

2 Likes

Hey, Aryan .

I guess it is impossible to get AC in first subtask and TLE in 2nd subtask.

Was anyone able to pull of this magic ? :stuck_out_tongue:

Please mention your strategy here :stuck_out_tongue:

1 Like

https://www.codechef.com/viewsolution/26686344
XD
Brute force gets AC in sub1 ( 1^n * 2^n-1 … )
https://www.codechef.com/viewsolution/26691873

1 Like