結果

問題 No.1680 Sum and Difference
ユーザー tcltktcltk
提出日時 2021-09-18 14:03:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 497 bytes
コンパイル時間 730 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 89,660 KB
最終ジャッジ日時 2023-09-13 00:44:36
合計ジャッジ時間 5,956 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 195 ms
89,448 KB
testcase_01 AC 193 ms
89,412 KB
testcase_02 AC 202 ms
89,480 KB
testcase_03 AC 202 ms
89,328 KB
testcase_04 WA -
testcase_05 AC 199 ms
89,432 KB
testcase_06 AC 197 ms
89,504 KB
testcase_07 AC 193 ms
89,180 KB
testcase_08 AC 195 ms
89,396 KB
testcase_09 AC 206 ms
89,260 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 200 ms
89,448 KB
testcase_17 AC 199 ms
89,604 KB
testcase_18 WA -
testcase_19 AC 196 ms
89,412 KB
testcase_20 AC 193 ms
89,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq


def input():
    return sys.stdin.readline()[:-1]


# sys.setrecursionlimit(1000000)

# _INPUT = """# paste here...
# """
# sys.stdin = io.StringIO(_INPUT)

INF = 10**10

MOD = 10**9+7

A, B = map(int, input().split())
A %= MOD
B %= MOD
if A%2 == B%2:
    ans = ((A+1)*(B+1)+A*B) % MOD
else:
    ans = (A*(B+1)+(A+1)*B) % MOD

print(ans)
0