結果

問題 No.365 ジェンガソート
ユーザー masa
提出日時 2016-04-29 22:23:40
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 428 ms
コンパイル使用メモリ 61,120 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 18:00:50
合計ジャッジ時間 1,909 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

int main() {
	int n;

	cin >> n;
	vector<int> a(n, 0);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	int ans = 0;
	int max_num = 0;
	for (int i = 0; i < n; i++) {
		if (max_num > a[i]) {
			ans++;
		}
		if (max_num < a[i]) {
			max_num = a[i];
		}
	}
	cout << ans << endl;
	return 0;
}
0