結果
| 問題 | No.365 ジェンガソート | 
| コンテスト | |
| ユーザー |  springroll | 
| 提出日時 | 2018-11-03 13:23:18 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 31 ms / 2,000 ms | 
| コード長 | 380 bytes | 
| コンパイル時間 | 1,789 ms | 
| コンパイル使用メモリ | 168,632 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-20 18:45:24 | 
| 合計ジャッジ時間 | 3,871 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 41 | 
ソースコード
#include "bits/stdc++.h"
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<int> a(N);
	int Ma=0, MA=0, cnt=0;
	for (int i = 0; i < N; i++) {
		cin >> a[i];
		if (Ma > a[i]) {
			cnt++;
			MA = max(MA,a[i]);
			//cout << a[i] << endl;
		}
		Ma = max(Ma, a[i]);
	}
	int ans=0;
	for (int i = 0; i < N; i++) {
		if (a[i] <= MA) {
			ans++;
		}
	}
	cout << ans << endl;
}
            
            
            
        