結果

問題 No.1680 Sum and Difference
ユーザー ansainansain
提出日時 2021-09-17 21:47:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 314 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 8,012 KB
最終ジャッジ日時 2023-09-12 07:13:50
合計ジャッジ時間 1,392 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,852 KB
testcase_01 AC 16 ms
7,912 KB
testcase_02 AC 16 ms
7,848 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 16 ms
7,884 KB
testcase_06 AC 15 ms
7,996 KB
testcase_07 AC 15 ms
7,856 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,856 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 15 ms
7,992 KB
testcase_14 AC 14 ms
7,816 KB
testcase_15 WA -
testcase_16 AC 15 ms
7,872 KB
testcase_17 AC 15 ms
7,856 KB
testcase_18 WA -
testcase_19 AC 15 ms
7,856 KB
testcase_20 AC 14 ms
7,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def yn(hantei, yes='Yes', no='No'): print(yes if hantei else no)
def p(*args): print(*args)
mod=10**9+7
a,b=map(int, input().split())
b=min(a,b)
if a%2==0:
    f=a+1
    ans=f+2*(2*f-1)*(b//2)
    if b%2==1:
        ans+=2*f
else:
    f=a
    ans=f+2*(2*f+1)*(b//2)
    if b%2==1:
        ans+=2*(f+1)
p(ans%mod)

0