M<2^60 なら、 8 倍してもオーバーフローしない((2^60-1)*8 = 2^63-8 < 2^63-1)から、繰り返し 8 乗法とかもできそう(3 倍弱速いかも?) typedef long long ll; ll multiply(ll A, ll B, ll M) { ll r = 0; while (B > 0) { if ((B & 7) != 0) r = (r + A * (B & 7)) % M; B >>= 3; A = (A << 3) % M; } return r; }
Hi, I couldn't solve green or cyan question. My atcoder profile is killua123. How to reach 1200+ ratings?
@AngrySadEight4 ай бұрын
I suppose it will be effective to practice solving ABC-D and ABC-E (in order to become able to solve during the contest time, speed is also important). If you become able to solve ABC-E at a rate of 50%, you can probably reach 1200+ rating.