結果
問題 | No.52 よくある文字列の問題 |
ユーザー |
|
提出日時 | 2016-01-20 06:59:41 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 90 ms / 5,000 ms |
コード長 | 280 bytes |
コンパイル時間 | 51 ms |
コンパイル使用メモリ | 7,680 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-09-22 05:24:09 |
合計ジャッジ時間 | 1,611 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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