結果

問題 No.365 ジェンガソート
ユーザー ant2357
提出日時 2016-04-29 23:50:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 442 bytes
コンパイル時間 808 ms
コンパイル使用メモリ 84,584 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 19:31:34
合計ジャッジ時間 2,415 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <deque>
#include <algorithm>

using namespace std;

int main() {
	vector<int> a;
	int n;
	cin >> n;

	for (int i = 0; i < n; i++) {
		int tmp;
		cin >> tmp;
		a.push_back(tmp);
	}

	int ans = 0;
	for (int i = n-1; i >-1; i--) {

		if (i != 0) {
			if (a[i - 1] > a[i]) {
				ans++;
			}
		}
	}

	cout << ans << endl;
	return 0;
}
0