結果

問題 No.170 スワップ文字列(Easy)
ユーザー d_nishiyama85d_nishiyama85
提出日時 2016-06-13 02:45:07
言語 Ruby
(3.3.0)
結果
AC  
実行時間 93 ms / 5,000 ms
コード長 189 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 11,456 KB
実行使用メモリ 15,576 KB
最終ジャッジ日時 2023-08-24 16:32:11
合計ジャッジ時間 3,344 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
15,432 KB
testcase_01 AC 84 ms
15,548 KB
testcase_02 AC 85 ms
15,568 KB
testcase_03 AC 84 ms
15,408 KB
testcase_04 AC 89 ms
15,456 KB
testcase_05 AC 85 ms
15,352 KB
testcase_06 AC 85 ms
15,288 KB
testcase_07 AC 85 ms
15,576 KB
testcase_08 AC 84 ms
15,540 KB
testcase_09 AC 84 ms
15,552 KB
testcase_10 AC 84 ms
15,300 KB
testcase_11 AC 85 ms
15,356 KB
testcase_12 AC 84 ms
15,576 KB
testcase_13 AC 85 ms
15,504 KB
testcase_14 AC 86 ms
15,536 KB
testcase_15 AC 85 ms
15,396 KB
testcase_16 AC 85 ms
15,564 KB
testcase_17 AC 84 ms
15,388 KB
testcase_18 AC 85 ms
15,392 KB
testcase_19 AC 93 ms
15,524 KB
testcase_20 AC 85 ms
15,420 KB
testcase_21 AC 85 ms
15,416 KB
testcase_22 AC 84 ms
15,380 KB
testcase_23 AC 83 ms
15,396 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'pp'

def fact n
  (1..n).inject(:*) || 1
end

s = gets.strip
a = s.split('')
group = a.group_by {|e| e}

res = fact s.length
group.each {|k, v|
  res /= fact v.length
}

pp res - 1
0