結果
| 問題 | No.52 よくある文字列の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-20 01:37:30 |
| 言語 | Ruby (4.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 179 bytes |
| 記録 | |
| コンパイル時間 | 281 ms |
| コンパイル使用メモリ | 9,216 KB |
| 実行使用メモリ | 15,232 KB |
| 最終ジャッジ日時 | 2026-05-17 03:59:41 |
| 合計ジャッジ時間 | 2,012 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 7 |
コンパイルメッセージ
Syntax OK
ソースコード
s = gets.chomp!
def solve(s)
return [s] if s.length <= 1
[s] + solve(s[0..-2]).map{|si| s[-1] + si } \
+ solve(s[1..-1]).map{|si| si + s[0] }
end
puts solve(s).uniq.size