結果

問題 No.171 スワップ文字列(Med)
ユーザー shi-moshi-mo
提出日時 2016-10-24 19:27:49
言語 Ruby
(3.2.2)
結果
AC  
実行時間 81 ms / 1,000 ms
コード長 201 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 11,240 KB
実行使用メモリ 16,000 KB
最終ジャッジ日時 2023-08-15 18:37:05
合計ジャッジ時間 2,086 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,028 KB
testcase_01 AC 78 ms
15,120 KB
testcase_02 AC 80 ms
15,480 KB
testcase_03 AC 77 ms
15,216 KB
testcase_04 AC 79 ms
15,108 KB
testcase_05 AC 80 ms
15,416 KB
testcase_06 AC 81 ms
15,696 KB
testcase_07 AC 81 ms
16,000 KB
testcase_08 AC 81 ms
15,800 KB
testcase_09 AC 81 ms
15,800 KB
testcase_10 AC 77 ms
15,244 KB
testcase_11 AC 79 ms
15,112 KB
testcase_12 AC 78 ms
15,316 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp

def factorial(i)
  (1..i).to_a.inject(:*)
end

c = s.split(//o).group_by{|a| a }.map{|_, ary| ary.size }
n = factorial(s.length)
c.each do |m|
  n /= factorial(m)
end
puts (n - 1) % 573
0