Блог пользователя L_H

Автор L_H, 12 лет назад, По-английски

I am solving this problem in O(m*n) but still TLE link to problem http://www.codechef.com/problems/PD12 Link to solution http://www.codechef.com/viewsolution/6514367

  • Проголосовать: нравится
  • -3
  • Проголосовать: не нравится

»
12 лет назад, скрыть # |
← Rev. 4  
Проголосовать: нравится 0 Проголосовать: не нравится

Add this on the top of the main function:

ios_base::sync_with_stdio(false);
cin.tie(NULL);

and then use '\n' instead of endl.

Edit: This cin>>t; confused me. I just saw it and assumed that you have used cin/cout...

»
12 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why don't you do a normal DFS or BFS?