結果

問題 No.186 中華風 (Easy)
ユーザー fmhrfmhr
提出日時 2015-04-20 00:00:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 10,752 KB
実行使用メモリ 7,968 KB
最終ジャッジ日時 2023-09-18 02:10:41
合計ジャッジ時間 1,531 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,772 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 16 ms
7,956 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 16 ms
7,896 KB
testcase_20 AC 16 ms
7,892 KB
testcase_21 AC 16 ms
7,716 KB
testcase_22 AC 16 ms
7,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding=utf-8
x = [0] * 3
y = [0] * 3
ans = [[] for i in range(3)]
def xy(y, x):
    r = []
    i = 0
    while x * i + y < 10 ** 6:
        r.append(x * i + y)
        i += 1
    return r

for i in range(3):
    x[i], y[i] = map(int, input().split())
for i in range(3):
    ans[i] = xy(x[i], y[i])

ans2 = set(ans[0]) & set(ans[1]) & set(ans[2])
if len(ans2) == 0:
    print('-1')
else:
    print(min(ans2))
0