結果

問題 No.1680 Sum and Difference
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-09-17 21:42:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 200 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 10,632 KB
実行使用メモリ 8,084 KB
最終ジャッジ日時 2023-09-12 07:07:34
合計ジャッジ時間 1,412 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,932 KB
testcase_01 AC 17 ms
8,084 KB
testcase_02 AC 16 ms
7,868 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 15 ms
8,064 KB
testcase_06 AC 15 ms
8,068 KB
testcase_07 AC 15 ms
7,916 KB
testcase_08 WA -
testcase_09 AC 15 ms
7,944 KB
testcase_10 AC 15 ms
7,824 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 15 ms
7,812 KB
testcase_17 AC 16 ms
7,928 KB
testcase_18 WA -
testcase_19 AC 15 ms
7,800 KB
testcase_20 AC 15 ms
7,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int, input().split())
if a == 0: exit(print(b if b % 2 else b + 1))
if b == 0: exit(print(a if a % 2 else a + 1))
p = (a + b) * 2
s = a * b * 2
print((p + (s - p // 2 + 1)) % (10 ** 9 + 7))
0