結果

問題 No.1259 スイッチ
ユーザー trineutrontrineutron
提出日時 2020-10-16 22:04:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 87,160 KB
実行使用メモリ 76,740 KB
最終ジャッジ日時 2023-09-28 03:10:01
合計ジャッジ時間 9,220 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 64 ms
71,404 KB
testcase_04 AC 69 ms
71,436 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 67 ms
71,060 KB
testcase_08 AC 66 ms
71,356 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 107 ms
76,360 KB
testcase_31 AC 127 ms
76,064 KB
testcase_32 AC 92 ms
76,264 KB
testcase_33 AC 152 ms
76,164 KB
testcase_34 AC 110 ms
76,104 KB
testcase_35 AC 128 ms
76,480 KB
testcase_36 AC 122 ms
76,208 KB
testcase_37 AC 119 ms
76,240 KB
testcase_38 AC 115 ms
76,396 KB
testcase_39 AC 139 ms
76,348 KB
testcase_40 AC 147 ms
76,460 KB
testcase_41 AC 129 ms
76,044 KB
testcase_42 AC 148 ms
76,364 KB
testcase_43 AC 115 ms
76,396 KB
testcase_44 AC 142 ms
76,328 KB
testcase_45 AC 148 ms
76,348 KB
testcase_46 AC 115 ms
76,188 KB
testcase_47 AC 150 ms
76,392 KB
testcase_48 AC 107 ms
76,324 KB
testcase_49 AC 145 ms
76,368 KB
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 AC 151 ms
76,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9 + 7

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