結果
| 問題 |
No.116 門松列(1)
|
| ユーザー |
siman
|
| 提出日時 | 2015-01-07 01:49:15 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 296 bytes |
| コンパイル時間 | 225 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-06-13 02:51:37 |
| 合計ジャッジ時間 | 3,310 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 3 |
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - n Syntax OK
ソースコード
class A
def initialize
n = gets.chomp.to_i
a = gets.chomp.split(' ').map(&:to_i)
count = 0
a.each_cons(3) do |list|
next if list.first == list.last
if list.max == list[1] || list.min == list[1]
count += 1
end
end
puts count
end
end
A.new
siman