結果

問題 No.1815 K色問題
ユーザー miztommiztom
提出日時 2024-03-14 05:23:02
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 375 bytes
コンパイル時間 536 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 75,496 KB
最終ジャッジ日時 2024-03-14 05:23:06
合計ジャッジ時間 3,557 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,460 KB
testcase_01 AC 38 ms
53,460 KB
testcase_02 RE -
testcase_03 AC 37 ms
53,460 KB
testcase_04 WA -
testcase_05 RE -
testcase_06 AC 442 ms
75,492 KB
testcase_07 WA -
testcase_08 RE -
testcase_09 AC 141 ms
75,456 KB
testcase_10 AC 227 ms
75,460 KB
testcase_11 RE -
testcase_12 AC 38 ms
53,460 KB
testcase_13 AC 37 ms
53,460 KB
testcase_14 RE -
testcase_15 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

M=10**9+7
n,m,k=map(int,input().split())
r,s=0,1
for i in range(k):
    if n==1:c=-~i*pow(i,m-1,M)%M
    elif n==2:c=-~i*i*pow(i*i-~i,m-1,M)%M
    else:
        a,b,c,d,e=~-i*(i*i-i+3)%M,(i-2-~i*~i*~i)%M,-~i*i*i%M,i*-~i*(i*i+~i)%M,m-1
        while e:c,d=(a*c%M-d,b*d%M)if e&1 else(c,(a*d-b*c)%M);a,b=(a*a-2*b)%M,b*b%M;l>>=1
    r+=(s:=s*pow(i+1,-1,M)*(i-k)%M)*c
print(r*s%M)
0