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

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

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

Thanks in advance!

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

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

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.