Codeforcess Round #788 (Div. 2) Problem B.
Here is the problem link.
I have used O(n) complexity code in my code, but I got TLE on test 35.
While my friend during the contest solved the problem has a total number of test cases 34.
This is my submission and I got TLE on test case no. 35.
And this is the last case for my friend's submission.
What is the problem??
In my submission, the 35th test is:
t = 10^5
and, i guess, every test case looks the same:
26 a b c d e f g h i j k l m n o p q r s t u v w x y z
I tried a lot with your code , but nothing worked
I finally removed the "scanf" and "printf" and added "cin" and "cout" with the fast i/o method , and it worked ! .
So either use (cin,cout) with fast i/o
or (scanf,printf) without fast i/o
fast i/o :
more likely skill issue