brucewayne123's blog

By brucewayne123, history, 8 years ago, In English

problem link:- http://codeforces.me/problemset/problem/221/D i have used mo's algorithm and my complexity fits in given time limit.. but still i am getting TLE on test 5.. please help.. my submission:- http://codeforces.me/contest/221/submission/18995087

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

»
8 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Try using scanf/printf and possibly unordered_map. I use these in my solution and it passed.

»
8 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

Change cin\cout to printf\scanf and compress values instead of using map. Code