結果
問題 | No.116 門松列(1) |
ユーザー |
|
提出日時 | 2019-04-30 14:07:21 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 91 ms / 5,000 ms |
コード長 | 178 bytes |
コンパイル時間 | 201 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-06-25 01:52:43 |
合計ジャッジ時間 | 3,048 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n Syntax OK
ソースコード
n = gets.to_i as = gets.split.map(&:to_i) ans = 0 as.each_cons(3) do |a, b, c| if a!=b && b!=c && c!=a && (b < a && b < c || b > a && b > c) ans += 1 end end puts ans