結果

問題 No.1680 Sum and Difference
ユーザー ansain
提出日時 2021-09-17 21:47:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 314 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-29 20:12:02
合計ジャッジ時間 1,421 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 8
権限があれば一括ダウンロードができます

ソースコード

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