dishown july long problem



the same solution when used faster i/o gave ac and without faster i/o gave tle … is it justified to use faster i/o to get ac ??
the link to the problem is


Actually its not necessary to use fast input output…
Have a look at my code…
I got AC without fast i/o…
There is always an alternative, just think!
Have fun!!!


There is no problem in using faster io to get ac , because if your algo is wrong it would still give tle if you use faster IO . Cin , cout are generally more slow , so even if you have used scanf and printf you could have got ac , without using faster IO .

Check Your solution using scanf and printf gives AC .


but still using cin and cout gives tle . its just amazing . but whatever it is , i learnt a few things


Got same problem with java Language. :frowning:


you have used scanf and printf . It would be very difficult to do this question using cin and cout .


If the reference to fast i/o is scanf and printf then I am sorry…
It is always recommended by admins (and good coders of codechef, codeforces etc) to always prefer scanf/printf over cin/cout…


An example to such case is “Enormous input test” problem of codechef


If you find my answer useful please upvote and accept it as correct answer .


I am not saying scanf and printf to be fast i/o . I am saying cin/cout will give tle while scanf and print won`t .