結果

問題 No.1680 Sum and Difference
ユーザー Sumitacchan
提出日時 2021-08-01 14:16:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 1,000 ms
コード長 254 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-06-29 17:42:34
合計ジャッジ時間 1,832 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
Created on Sun Aug  1 14:11:40 2021

@author: sumitacchan
"""

A, B = map(int, input().split())
mod = 10**9 + 7

if A % 2 == B % 2:
    ans = ((2*A+1)*(2*B+1)+1)//2
else:
    ans = ((2*A+1)*(2*B+1)-1)//2

ans %= mod
print(ans)
0