結果

問題 No.1680 Sum and Difference
ユーザー SumitacchanSumitacchan
提出日時 2021-08-01 14:16:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 1,000 ms
コード長 254 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 86,732 KB
実行使用メモリ 71,392 KB
最終ジャッジ日時 2023-09-12 04:41:45
合計ジャッジ時間 3,655 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,216 KB
testcase_01 AC 71 ms
71,304 KB
testcase_02 AC 71 ms
71,216 KB
testcase_03 AC 70 ms
71,100 KB
testcase_04 AC 72 ms
71,260 KB
testcase_05 AC 72 ms
71,148 KB
testcase_06 AC 71 ms
71,132 KB
testcase_07 AC 71 ms
71,132 KB
testcase_08 AC 70 ms
70,940 KB
testcase_09 AC 70 ms
71,164 KB
testcase_10 AC 70 ms
71,348 KB
testcase_11 AC 70 ms
71,200 KB
testcase_12 AC 72 ms
71,064 KB
testcase_13 AC 73 ms
71,392 KB
testcase_14 AC 72 ms
71,204 KB
testcase_15 AC 70 ms
71,240 KB
testcase_16 AC 71 ms
71,036 KB
testcase_17 AC 71 ms
71,212 KB
testcase_18 AC 71 ms
71,148 KB
testcase_19 AC 70 ms
71,084 KB
testcase_20 AC 69 ms
71,264 KB
権限があれば一括ダウンロードができます

ソースコード

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