結果
問題 |
No.116 門松列(1)
|
ユーザー |
![]() |
提出日時 | 2015-08-23 20:25:00 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 240 bytes |
コンパイル時間 | 75 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-07-18 13:04:00 |
合計ジャッジ時間 | 2,874 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 13 |
コンパイルメッセージ
Main.rb:6: warning: assigned but unused variable - y Main.rb:5: warning: possibly useless use of - in void context Syntax OK
ソースコード
N=gets.to_i A=gets.split.map(&:to_i) cnt=0 N-3.times do |t| x,y,z=s=A.slice(t,3) next if s.uniq.size != 3 #puts "x:#{x} y:#{y} z:#{z} max:#{s.max} min:#{s.min}" cnt+=1 if (x!=s.max && x!=s.min) || (z!=s.max && z!=s.min) end p cnt