結果

問題 No.1680 Sum and Difference
ユーザー puznekopuzneko
提出日時 2021-11-12 23:24:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 228 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 8,004 KB
最終ジャッジ日時 2023-08-17 04:02:14
合計ジャッジ時間 2,654 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

a, b = map(int, input().split())
p = 10 ** 9 + 7
a = a % p
b = b % p
ans = 0
if (a - b) % 2 == 0:
    ans = (((a+1) * (b+1)) % p + (a * b) % p) % p
else:
    ans = (((a+1) * b) % p + (a * (b+1)) % p) % p
print("{}".format(ans))
0