結果
| 問題 | No.52 よくある文字列の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-01-20 06:59:41 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 5,000 ms |
| コード長 | 280 bytes |
| 記録 | |
| コンパイル時間 | 95 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 14,848 KB |
| 最終ジャッジ日時 | 2026-04-10 11:08:06 |
| 合計ジャッジ時間 | 1,498 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
Syntax OK
ソースコード
H = {}
def fill_hash(cs, str)
if cs.size <= 0 then
H[str] = true
return
end
cs_dup = cs.dup
str_dup = str.dup
str_dup << cs_dup.pop
fill_hash(cs_dup, str_dup)
str << cs.shift
fill_hash(cs, str)
end
CS = gets.chomp.chars
fill_hash(CS, "")
puts H.size