結果

問題 No.365 ジェンガソート
ユーザー ldsyb
提出日時 2016-04-29 22:46:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 267 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 63,956 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-04 18:22:32
合計ジャッジ時間 1,971 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

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