結果

問題 No.2117 中国剰余定理入門
ユーザー u_kunu_kun
提出日時 2022-11-04 21:27:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 393 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 71,568 KB
最終ジャッジ日時 2023-09-25 23:40:41
合計ジャッジ時間 2,803 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,272 KB
testcase_01 AC 73 ms
71,568 KB
testcase_02 AC 77 ms
71,208 KB
testcase_03 AC 75 ms
71,476 KB
testcase_04 AC 72 ms
71,344 KB
testcase_05 AC 73 ms
71,348 KB
testcase_06 AC 72 ms
71,392 KB
testcase_07 AC 73 ms
71,348 KB
testcase_08 AC 75 ms
71,528 KB
testcase_09 AC 74 ms
71,380 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 74 ms
71,080 KB
testcase_13 WA -
testcase_14 AC 71 ms
71,200 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 75 ms
71,212 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# nは0以上99以下しかない

B0, C0 = map(int, input().split())
B1, C1 = map(int, input().split())

def mod_equal(A, B, dev):
    """Aをdevで割った余りとBをdevで割った余りが等しければTrue"""
    
    if A % dev == B % dev:
        return True

for n in range(100):
    if mod_equal(n, C0, B0) and mod_equal(n, C1, B1):
        print(n)
        exit()


print("NaN")
0