Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Блог пользователя jjuice

Автор jjuice, история, 8 лет назад, По-английски

I was solving this problem which reduces down to solving the following n variable equations :

a1x1 + a2x2 + a3x3 +.... = 1mod2
b1x1 + b2x2 + b3x3 + ... = 1mod2
..

I am aware that I have to use something on the lines of Gaussian algorithm. However simple Gauss is not giving the correct answer as it involves modular arithmetic. How do I solve such equations involving multiple mods ? Thank you :)

  • Проголосовать: нравится
  • -2
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Simple Gaussian elimination works fine; you must only use the proper arithmetic operations for the field of two elements (e.g. 1 + 1 = 0).