Doubts om problem E1165

Revision en1, by Master0fPuppets, 2021-04-15 23:47:11

Hi guys

Problem:https://codeforces.com/contest/1165/problem/E

I don't know why this solution (https://ideone.com/Q3bmkC) works and this (https://ideone.com/YJx6XI) doesn't

Both are the same idea the problem is just with the mod. I thought in the wrong solution that mod is distributed on multiplication so I didn't write (a[i]%mod *b[i]%mod) instead I wrote it as (a[i]*b[i])%mod so can someone explain it to me why this gave WA!

Tags #modulo, #math, doubts

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Master0fPuppets 2021-04-15 23:47:11 462 Initial revision (published)