結果
問題 | No.116 門松列(1) |
ユーザー |
![]() |
提出日時 | 2018-03-02 14:51:49 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 87 ms / 5,000 ms |
コード長 | 220 bytes |
コンパイル時間 | 245 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-06-25 01:37:17 |
合計ジャッジ時間 | 3,237 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
コンパイルメッセージ
Syntax OK
ソースコード
i = gets.to_i - 3 array = gets.split.map(&:to_i) puts (0..i).inject(0) { |count, i| count += 1 if (array[i, 3].max == array[i+1] || array[i, 3].min == array[i+1]) && array[i, 3].size == array[i, 3].uniq.size count }