結果
| 問題 |
No.273 回文分解
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-31 11:35:29 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 376 bytes |
| コンパイル時間 | 112 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-09-21 20:18:11 |
| 合計ジャッジ時間 | 4,106 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 28 WA * 4 |
コンパイルメッセージ
Main.rb:23: warning: `elsif' at the end of line without an expression Syntax OK
ソースコード
s=gets
if s==s.reverse then
if s.length == 2 then
puts 1
return
end
puts s.length-2
return
end
pos = Array.new()
for i in (0..s.length-1)
for j in (i+1..s.length-1)
if s[i..j] == s[i..j].reverse then
pos.push(j-i+1)
end
end
end
if pos.length == 0 then
puts 1
elsif
puts pos.max
end