rohit661's blog

By rohit661, 6 years ago, In English

I got TLE(test case no. 23) in https://mirror.codeforces.com/contest/598/submission/68870135 someone help me.

Thanks in advance!

  • Vote: I like it
  • +6
  • Vote: I do not like it

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

Changing the following declarations

string gp[(int)1e3+7];
map<pair<int,int>,bool> vis;
map<pair<int,int>,int> ans;

to

const int N = 1e3+7;
string gp[N]; bool vis[N][N]; int ans[N][N];

and making the necessary update to the references of vis and ans as two-dimensional array variables instead of C++ STL map objects was sufficient to get your code accepted 68874723.