結果

問題 No.1259 スイッチ
ユーザー trineutrontrineutron
提出日時 2020-10-16 23:04:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 402 ms
コンパイル使用メモリ 87,340 KB
実行使用メモリ 76,624 KB
最終ジャッジ日時 2023-09-28 05:02:41
合計ジャッジ時間 10,751 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,396 KB
testcase_01 AC 74 ms
71,160 KB
testcase_02 AC 71 ms
71,572 KB
testcase_03 AC 73 ms
71,600 KB
testcase_04 AC 74 ms
71,516 KB
testcase_05 AC 73 ms
71,368 KB
testcase_06 AC 75 ms
71,264 KB
testcase_07 AC 73 ms
71,296 KB
testcase_08 AC 74 ms
71,368 KB
testcase_09 AC 73 ms
71,408 KB
testcase_10 AC 130 ms
76,380 KB
testcase_11 AC 158 ms
76,324 KB
testcase_12 AC 124 ms
76,268 KB
testcase_13 AC 106 ms
76,228 KB
testcase_14 AC 117 ms
76,600 KB
testcase_15 AC 107 ms
76,380 KB
testcase_16 AC 143 ms
76,276 KB
testcase_17 AC 119 ms
76,356 KB
testcase_18 AC 150 ms
76,408 KB
testcase_19 AC 152 ms
76,500 KB
testcase_20 AC 131 ms
76,344 KB
testcase_21 AC 161 ms
76,332 KB
testcase_22 AC 105 ms
76,156 KB
testcase_23 AC 148 ms
76,296 KB
testcase_24 AC 134 ms
76,480 KB
testcase_25 AC 131 ms
76,236 KB
testcase_26 AC 162 ms
76,332 KB
testcase_27 AC 146 ms
76,216 KB
testcase_28 AC 132 ms
76,280 KB
testcase_29 AC 145 ms
76,624 KB
testcase_30 AC 120 ms
76,352 KB
testcase_31 AC 139 ms
76,212 KB
testcase_32 AC 106 ms
76,212 KB
testcase_33 AC 162 ms
76,332 KB
testcase_34 AC 130 ms
76,316 KB
testcase_35 AC 144 ms
76,316 KB
testcase_36 AC 139 ms
76,476 KB
testcase_37 AC 132 ms
76,304 KB
testcase_38 AC 130 ms
76,348 KB
testcase_39 AC 158 ms
76,280 KB
testcase_40 AC 160 ms
76,412 KB
testcase_41 AC 144 ms
76,316 KB
testcase_42 AC 161 ms
76,328 KB
testcase_43 AC 128 ms
76,156 KB
testcase_44 AC 153 ms
76,320 KB
testcase_45 AC 162 ms
76,196 KB
testcase_46 AC 124 ms
76,236 KB
testcase_47 AC 162 ms
76,328 KB
testcase_48 AC 117 ms
76,288 KB
testcase_49 AC 158 ms
76,424 KB
testcase_50 AC 125 ms
76,620 KB
testcase_51 AC 103 ms
76,340 KB
testcase_52 AC 158 ms
76,308 KB
testcase_53 AC 118 ms
76,372 KB
testcase_54 AC 159 ms
76,520 KB
testcase_55 AC 102 ms
76,240 KB
testcase_56 AC 119 ms
76,304 KB
testcase_57 AC 151 ms
76,304 KB
testcase_58 AC 131 ms
76,388 KB
testcase_59 AC 141 ms
76,320 KB
testcase_60 AC 163 ms
76,356 KB
権限があれば一括ダウンロードができます

ソースコード

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=x*(n-i)*v%d
if m==1:print(s%d)
else:print((pow(n,n,d)-s)*pow(n-1,d-2,d)%d)
0