結果

問題 No.1680 Sum and Difference
ユーザー rlangevin
提出日時 2022-12-31 18:55:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 1,000 ms
コード長 173 bytes
コンパイル時間 471 ms
コンパイル使用メモリ 82,032 KB
実行使用メモリ 53,668 KB
最終ジャッジ日時 2024-11-26 17:26:15
合計ジャッジ時間 1,968 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

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