結果

問題 No.3179 3 time mod
ユーザー hello_lim
提出日時 2025-06-14 11:30:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 246 bytes
コンパイル時間 385 ms
コンパイル使用メモリ 82,608 KB
実行使用メモリ 53,892 KB
最終ジャッジ日時 2025-06-14 11:30:13
合計ジャッジ時間 3,697 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
P, Q, R = map(int, input().split())
A, B, C = map(int, input().split())

N1 = pow(Q*R, -1, P)%P
N2 = pow(R*P, -1, Q)%Q
N3 = pow(P*Q, -1, R)%R

x = (A*Q*R*N1 + B*R*P*N2 + C*P*Q*N3)%(P*Q*R)

print((N-x)//(P*Q*R)+1 if x <= N else 0)
0