結果

問題 No.1680 Sum and Difference
ユーザー rlangevinrlangevin
提出日時 2022-12-31 18:55:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 1,000 ms
コード長 173 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 71,552 KB
最終ジャッジ日時 2023-08-17 18:26:55
合計ジャッジ時間 3,602 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,500 KB
testcase_01 AC 74 ms
71,484 KB
testcase_02 AC 74 ms
71,520 KB
testcase_03 AC 74 ms
71,552 KB
testcase_04 AC 75 ms
71,448 KB
testcase_05 AC 72 ms
71,412 KB
testcase_06 AC 70 ms
71,548 KB
testcase_07 AC 70 ms
71,180 KB
testcase_08 AC 72 ms
71,464 KB
testcase_09 AC 73 ms
71,348 KB
testcase_10 AC 73 ms
71,236 KB
testcase_11 AC 74 ms
71,268 KB
testcase_12 AC 74 ms
71,384 KB
testcase_13 AC 67 ms
71,228 KB
testcase_14 AC 70 ms
71,200 KB
testcase_15 AC 74 ms
71,460 KB
testcase_16 AC 74 ms
71,180 KB
testcase_17 AC 74 ms
71,336 KB
testcase_18 AC 68 ms
71,168 KB
testcase_19 AC 68 ms
71,364 KB
testcase_20 AC 71 ms
71,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())
mod = 10 ** 9 + 7
if B % 2 != A % 2:
    print( ((B + 1) * (A) + (B) * (A + 1))%mod )
else:
    print( ((B) * (A) + (B + 1) * (A + 1))%mod )
0