結果

問題 No.186 中華風 (Easy)
ユーザー convexineqconvexineq
提出日時 2020-12-15 21:15:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 81,620 KB
実行使用メモリ 59,672 KB
最終ジャッジ日時 2023-10-20 06:41:36
合計ジャッジ時間 2,505 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
59,672 KB
testcase_01 AC 48 ms
59,672 KB
testcase_02 AC 53 ms
59,672 KB
testcase_03 AC 46 ms
59,672 KB
testcase_04 AC 51 ms
59,672 KB
testcase_05 AC 52 ms
59,672 KB
testcase_06 AC 60 ms
59,672 KB
testcase_07 AC 51 ms
59,672 KB
testcase_08 AC 60 ms
59,672 KB
testcase_09 AC 60 ms
59,672 KB
testcase_10 AC 59 ms
59,672 KB
testcase_11 AC 66 ms
59,672 KB
testcase_12 AC 48 ms
59,672 KB
testcase_13 AC 53 ms
59,672 KB
testcase_14 AC 49 ms
59,672 KB
testcase_15 AC 44 ms
57,620 KB
testcase_16 AC 52 ms
59,672 KB
testcase_17 AC 46 ms
59,672 KB
testcase_18 AC 47 ms
59,672 KB
testcase_19 AC 47 ms
57,488 KB
testcase_20 AC 43 ms
57,488 KB
testcase_21 AC 46 ms
57,488 KB
testcase_22 AC 46 ms
57,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
a,b = map(int,input().split())
if a==0: a = b
for _ in range(2):
    x,y = map(int,input().split())
    for i in range(y):
        if a%y == x: break
        a += b
    else:
        print(-1)
        exit()
    b *= y//gcd(b,y)
print(a)
0