結果

問題 No.1680 Sum and Difference
ユーザー timi
提出日時 2021-09-22 10:19:50
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 1,000 ms
コード長 120 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-07-04 22:14:31
合計ジャッジ時間 1,581 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

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