strawhatdragon's blog

By strawhatdragon, history, 6 weeks ago, In English

Hi All

Can someone help find the fault in the logic ?

https://codeforces.com/contest/1534/submission/119410596

Regards

 
 
 
 
  • Vote: I like it
  • -9
  • Vote: I do not like it

»
6 weeks ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Your code misses one of cases when there is all '.' and only one element in grid which is either 'W' or 'R'.
Try this test case :-
1
3 3
...
.W.
...
Your O/P:- NO
Correct O/P:- YES

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

I think the fault in your logic is that you only consider the local locations (top, down, left, right) of a specific cell.

Hint / Observation: