結果

問題 No.2117 中国剰余定理入門
ユーザー タコイモタコイモ
提出日時 2022-11-04 21:26:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 86,824 KB
実行使用メモリ 75,916 KB
最終ジャッジ日時 2023-09-25 23:38:53
合計ジャッジ時間 2,754 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,200 KB
testcase_01 AC 73 ms
71,040 KB
testcase_02 AC 69 ms
71,272 KB
testcase_03 AC 70 ms
71,180 KB
testcase_04 AC 74 ms
71,332 KB
testcase_05 AC 74 ms
75,908 KB
testcase_06 AC 68 ms
71,184 KB
testcase_07 AC 71 ms
75,904 KB
testcase_08 AC 76 ms
75,916 KB
testcase_09 AC 67 ms
71,360 KB
testcase_10 AC 68 ms
71,024 KB
testcase_11 AC 67 ms
71,228 KB
testcase_12 AC 75 ms
75,832 KB
testcase_13 AC 71 ms
70,992 KB
testcase_14 AC 79 ms
75,760 KB
testcase_15 AC 73 ms
75,388 KB
testcase_16 AC 67 ms
71,352 KB
testcase_17 AC 72 ms
75,496 KB
testcase_18 AC 76 ms
75,912 KB
testcase_19 AC 67 ms
71,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b = map(int,input().split())
c,d = map(int,input().split())
s = b % a
t = d % c
check = 0
for i in range(1000):
  for j in range(1000):
    if s + a*i == t + c*j:
      print(s+a*i)
      check = 1
      exit()
    if s + a*i < t + c*j:
      break
print('NaN')
0