結果

問題 No.116 門松列(1)
コンテスト
ユーザー Takeno_hito
提出日時 2017-09-30 17:29:15
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 391 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 718 ms
コンパイル使用メモリ 96,880 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-10 20:54:49
合計ジャッジ時間 1,691 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <random>
#include <algorithm>
#define INF 1000000000
using namespace std;
// #define int long long



signed main(){
  int N;
  int A[1000];
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> A[i];
  }
  int c =0;
  for(int i=0;i<(N-2);i++){
    if(max(A[i],max(A[i+1],A[i+2]))!=A[i] && A[i]!=A[i+1] && A[i+1]!=A[i+2] && A[i]!=A[i+2])c++;
  }
  cout << c << endl;
}
0