Sir can you explain the transitions again? i mean why you used AND if turn==0 and OR otherwise
@soumyabhattacharjee1051
2 ай бұрын
ans means who is winning. Its initialized to the opposite of the current player. So let say if its 0's turn then ans=1. Now if any one of the possible (i,j) leads us to the 0 then the current player will win. So we are taking bitwise and. Because only one 0 will make the answer 0. Similar for 1, we are taking OR because only one 1 will make the ans 1. If you find this helpful please like, share and subscribe, thanks
@darkknight98-v
2 ай бұрын
@@soumyabhattacharjee1051 oh got it! thanks a lot again! also sir, can you refer some problems of bitmask dp(cf or atcoder) to practice because I just got introduced to it through this video.
@user-up3ne1sq6t2 ай бұрын
why we are using & in 67th line and | in 68th line this portion is not clear
@soumyabhattacharjee1051
2 ай бұрын
ans means who is winning. Its initialized to the opposite of the current player. So let say if its 0's turn then ans=1. Now if any one of the possible (i,j) leads us to the 0 then the current player will win. So we are taking bitwise and. Because only one 0 will make the answer 0. Similar for 1, we are taking OR because only one 1 will make the ans 1. If you find this helpful please like, share and subscribe, thanks
Пікірлер: 5
Sir can you explain the transitions again? i mean why you used AND if turn==0 and OR otherwise
@soumyabhattacharjee1051
2 ай бұрын
ans means who is winning. Its initialized to the opposite of the current player. So let say if its 0's turn then ans=1. Now if any one of the possible (i,j) leads us to the 0 then the current player will win. So we are taking bitwise and. Because only one 0 will make the answer 0. Similar for 1, we are taking OR because only one 1 will make the ans 1. If you find this helpful please like, share and subscribe, thanks
@darkknight98-v
2 ай бұрын
@@soumyabhattacharjee1051 oh got it! thanks a lot again! also sir, can you refer some problems of bitmask dp(cf or atcoder) to practice because I just got introduced to it through this video.
why we are using & in 67th line and | in 68th line this portion is not clear
@soumyabhattacharjee1051
2 ай бұрын
ans means who is winning. Its initialized to the opposite of the current player. So let say if its 0's turn then ans=1. Now if any one of the possible (i,j) leads us to the 0 then the current player will win. So we are taking bitwise and. Because only one 0 will make the answer 0. Similar for 1, we are taking OR because only one 1 will make the ans 1. If you find this helpful please like, share and subscribe, thanks