Comments
0

don't know how to fix it( added code

0

oh, sry, fixed now

+4

Your solution didn't TL on some large tests, may be problem in infinite loop (also we opened tests)

There solution with formula for searching min x in $$$O(1)$$$: 157928657

Code

The problem in this line:

bool check(int i,int j,vector<vector<char>> v,vector<vector<int>> vis)

Your vector<vector<char>> v and vector<vector<int>> vis are copied every time, when you call this function. Instead you should write somthing like: bool check(int i,int j,vector<vector<char>> &v,vector<vector<int>> &vis)

there is your AC solution with this fix 138716320

And write "\n" instead endl, because endl flushing output, what takes time (sorry for my bad english)

I think it because if $$$a$$$ $$$xor$$$ $$$b$$$ == $$$c$$$ it means that $$$a$$$ $$$xor$$$ $$$c$$$ = $$$b$$$, so if you found indexes $$$i$$$ and $$$j$$$ and $$$a_i$$$ $$$xor$$$ $$$b_j$$$ $$$=$$$ (number in second array), you can choose this number and get $$$a_i$$$ $$$xor$$$ (this number) = $$$b_j$$$. If this number in first array, you can choose (this number) $$$xor$$$ $$$b_j$$$ = $$$a_i$$$. So if you found pair you can also find another pair.

i have same problem(

0