Antor_1809032's blog

By Antor_1809032, history, 22 months ago, In English

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??

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
22 months ago, # |
  Vote: I like it 0 Vote: I do not like it

In my submission, the 35th test is:

t = 10^5

and, i guess, every test case looks the same:

2

ab

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

»
22 months ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

Hello

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 :

ios::sync_with_stdio(NULL);
cin.tie(NULL);cout.tie(NULL);
»
22 months ago, # |
  Vote: I like it +8 Vote: I do not like it

more likely skill issue