結果

問題 No.816 Beautiful tuples
ユーザー oz4point5oz4point5
提出日時 2019-04-19 21:29:05
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 288 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 81,748 KB
実行使用メモリ 57,432 KB
最終ジャッジ日時 2023-10-23 23:23:38
合計ジャッジ時間 5,923 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,452 KB
testcase_01 AC 37 ms
53,452 KB
testcase_02 AC 74 ms
57,432 KB
testcase_03 AC 259 ms
57,432 KB
testcase_04 AC 79 ms
57,432 KB
testcase_05 AC 808 ms
57,432 KB
testcase_06 AC 120 ms
57,432 KB
testcase_07 AC 284 ms
57,432 KB
testcase_08 AC 179 ms
57,432 KB
testcase_09 AC 212 ms
57,432 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

a,b = map(int,input().split())

ans = 0
for c in range(1,a+b+1):
    if  (b + c) % a == 0:
        if a != b and b != c and c != a:
            if (a + c) % b == 0 and (b + a) % c == 0:
                ans = c
                break
else:
    ans = -1

print(ans)
0