Product Modulo help!

if a[i] is 1 then its contribution will be zero right ?
because 1 modulo 1 is 0
1
5 2
1 1 1 1 1

Should be 0
Not 5%2

3 Likes

Seen you after a long time, really missed you @l_returns

2 Likes

:slight_smile: Same here

4 Likes

hell yes… i forgot :clap:

1 Like

Awwwwwwww :rofl::rofl::rofl::rofl::rofl:

They have weak test cases :frowning:

1 Like

Why? Your logic have AC?

yesss
print(n%m) :slight_smile:

1 Like

Damn… weak af… Can you please help me in this too… please please please

I divide the n/m and then checked whether it’s divisible by 2 or not. It passed half of the test cases… where must I have gone wrong?

Not weak, Wrong test cases LOL.
They also forgot it.
Test Case #3 fails with my soln

1 Like

:joy::joy::joy::rofl::rofl: bhai bhai

whats your solution ?

number of 1’s=k and then (n-k)%m

1 Like

Local contest requires local solution

2 Likes

XD

1 Like

Bro. Can you please help this alone? Please. Thanks

check n%(m+1).
if 0 then no;
else yes;

1 Like

Yes. This gave AC. Can you please explain? Thanks

Can you explain?

Yes , Its simple.
Whoever remains with m+1 tiles will loose surely because he can’t pick all the tiles and must pick at least one tile and hence the opponent can pick all the remaining tiles.
Therefore optimal game play is to play such that the other player is left with m+1 tiles.

3 Likes