結果

問題 No.758 VVVVV
ユーザー cielciel
提出日時 2018-12-07 00:43:20
言語 Ruby
(3.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 181 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 18,816 KB
最終ジャッジ日時 2024-04-22 03:00:19
合計ジャッジ時間 4,614 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 89 ms
12,288 KB
testcase_02 AC 87 ms
12,288 KB
testcase_03 AC 173 ms
18,816 KB
testcase_04 AC 127 ms
15,104 KB
testcase_05 AC 115 ms
13,952 KB
testcase_06 AC 114 ms
13,824 KB
testcase_07 AC 170 ms
18,816 KB
testcase_08 AC 132 ms
15,488 KB
testcase_09 AC 99 ms
13,184 KB
testcase_10 AC 114 ms
14,464 KB
testcase_11 AC 167 ms
18,816 KB
testcase_12 AC 114 ms
13,440 KB
testcase_13 AC 115 ms
14,080 KB
testcase_14 AC 102 ms
13,312 KB
testcase_15 AC 97 ms
12,672 KB
testcase_16 AC 95 ms
13,184 KB
testcase_17 AC 150 ms
17,408 KB
testcase_18 AC 123 ms
15,104 KB
testcase_19 AC 167 ms
18,816 KB
testcase_20 AC 108 ms
13,696 KB
testcase_21 AC 111 ms
13,952 KB
testcase_22 AC 175 ms
18,816 KB
testcase_23 AC 83 ms
12,288 KB
testcase_24 AC 81 ms
12,288 KB
testcase_25 AC 82 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

M=10**9+7;I=[1,1];*F=I;*R=I;n=gets.to_i-1
2.upto(n){|i|I<<z=(M-M/i)*I[M%i]%M;F<<i*F[-1]%M;R<<z*R[-1]%M}
r=$<.map(&:to_i).uniq.size
p r<1?1:F[n]**2*R[r]*R[n-r]*R[r-1]*R[n-r+1]*I[n]%M
0