結果

問題 No.1259 スイッチ
ユーザー trineutron
提出日時 2020-10-16 23:03:59
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 188 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 265,600 KB
最終ジャッジ日時 2024-07-20 23:33:38
合計ジャッジ時間 4,406 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 TLE * 1 -- * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

d=10**9+7
n,k,m=map(int,input().split())
v=pow(n,d-2,d)
x=pow(n,n-1,d)
s=0
for i in range(1,n+1):
 if k%i==0:s+=x
 x*=(n-i)*v
if m==1:print(s%d)
else:print((pow(n,n,d)-s)*pow(n-1,d-2,d)%d)
0