結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,280 KB
testcase_01 AC 72 ms
71,296 KB
testcase_02 AC 73 ms
71,400 KB
testcase_03 AC 73 ms
71,420 KB
testcase_04 AC 76 ms
71,428 KB
testcase_05 AC 73 ms
71,400 KB
testcase_06 AC 72 ms
71,404 KB
testcase_07 AC 72 ms
71,152 KB
testcase_08 AC 73 ms
71,356 KB
testcase_09 AC 72 ms
71,468 KB
testcase_10 AC 123 ms
76,380 KB
testcase_11 AC 152 ms
76,444 KB
testcase_12 AC 122 ms
76,152 KB
testcase_13 AC 106 ms
76,320 KB
testcase_14 AC 116 ms
76,580 KB
testcase_15 AC 105 ms
76,400 KB
testcase_16 AC 141 ms
76,316 KB
testcase_17 AC 116 ms
76,396 KB
testcase_18 AC 151 ms
76,376 KB
testcase_19 AC 151 ms
76,240 KB
testcase_20 AC 128 ms
76,088 KB
testcase_21 AC 157 ms
76,336 KB
testcase_22 AC 102 ms
76,372 KB
testcase_23 AC 147 ms
76,216 KB
testcase_24 AC 131 ms
76,356 KB
testcase_25 AC 131 ms
76,156 KB
testcase_26 AC 155 ms
76,296 KB
testcase_27 AC 144 ms
76,376 KB
testcase_28 AC 129 ms
76,152 KB
testcase_29 AC 141 ms
76,280 KB
testcase_30 AC 117 ms
76,404 KB
testcase_31 AC 136 ms
76,316 KB
testcase_32 AC 101 ms
76,424 KB
testcase_33 AC 160 ms
76,160 KB
testcase_34 AC 118 ms
76,312 KB
testcase_35 AC 144 ms
76,392 KB
testcase_36 AC 131 ms
76,172 KB
testcase_37 AC 131 ms
76,148 KB
testcase_38 AC 129 ms
76,408 KB
testcase_39 AC 155 ms
76,116 KB
testcase_40 AC 153 ms
76,220 KB
testcase_41 AC 140 ms
76,128 KB
testcase_42 AC 156 ms
76,224 KB
testcase_43 AC 125 ms
76,344 KB
testcase_44 AC 154 ms
76,192 KB
testcase_45 AC 159 ms
76,336 KB
testcase_46 AC 121 ms
76,152 KB
testcase_47 AC 158 ms
76,352 KB
testcase_48 AC 115 ms
76,212 KB
testcase_49 AC 159 ms
76,392 KB
testcase_50 AC 123 ms
76,308 KB
testcase_51 AC 100 ms
76,116 KB
testcase_52 AC 150 ms
76,220 KB
testcase_53 AC 113 ms
76,392 KB
testcase_54 AC 152 ms
76,348 KB
testcase_55 AC 102 ms
76,216 KB
testcase_56 AC 116 ms
76,084 KB
testcase_57 AC 149 ms
76,332 KB
testcase_58 AC 123 ms
76,316 KB
testcase_59 AC 138 ms
76,396 KB
testcase_60 AC 165 ms
76,220 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
s%=d
if m==1:print(s)
else:print((pow(n,n,d)-s)*pow(n-1,d-2,d)%d)
0