結果

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

const int MAX_N=1e5;

int N;
int a[MAX_N];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin>>N;
	REP(i,N){
		cin>>a[i];
	}
	int ans=0;
	int ma=a[0];
	FOR(i,1,N){
		if (ma>a[i]) ans++;
		ma=max(ma,a[i]);
	}
	cout<<ans<<"\n";
	return 0;
}
0