結果

問題 No.116 門松列(1)
ユーザー nnasen
提出日時 2017-08-31 03:39:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 381 bytes
コンパイル時間 1,599 ms
コンパイル使用メモリ 165,968 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-06 14:54:50
合計ジャッジ時間 2,540 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 7 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define sz(n) (int)(n).size()
using namespace std;
typedef long long ll;

int main() {
	int n, a[101];
	cin >> n;
	int ans = 0;
	REP(i, n) cin >> a[i];
	FOR(i, 2, n + 1) {
		if ((a[i] != a[i - 2]) && (a[i - 1] > max(a[i], a[i - 2]))) ans++;
	}
	cout << ans << endl;
	return 0;
}
0