結果

問題 No.816 Beautiful tuples
ユーザー neko_the_shadowneko_the_shadow
提出日時 2019-04-19 21:35:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 366 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 11,784 KB
実行使用メモリ 10,124 KB
最終ジャッジ日時 2023-10-23 23:53:53
合計ジャッジ時間 1,392 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 27 ms
10,124 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 28 ms
10,124 KB
testcase_09 AC 28 ms
10,124 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 28 ms
10,124 KB
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# a + b = z * c
# b + c = x * a
# c + a = y * b
# 両辺をそれぞれ足し合わせると
# 2 * a + 2 * b + 2 * c = x * a + y * b + z * c
# <=> (2 - x) * a + (2 - y) * b + (2 - z) * c = 0
# a, b, cは自然数より、x = 2, y = 2, c = 2
# よって a * b = 2 * c 

a, b = map(int, input().split())
if (a + b) % 2 == 0:
    print((a + b) // 2)
else:
    print(-1)
0