Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
akrasuski1
on Aug 23, 2018
|
parent
|
context
|
favorite
| on:
Mod and remainder are not the same
Well, that's why I always define RED(x) (for reduce modulo) as ((((x) % MOD) + MOD) % MOD). Quite useful in algorithmic competitions, which often ask you for answer modulo some prime.
Consider applying for YC's Summer 2025 batch! Applications are open till May 13
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: