結果
| 問題 |
No.365 ジェンガソート
|
| コンテスト | |
| ユーザー |
h_noson
|
| 提出日時 | 2016-04-30 11:23:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 2,000 ms |
| コード長 | 534 bytes |
| コンパイル時間 | 507 ms |
| コンパイル使用メモリ | 60,192 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-12 01:55:25 |
| 合計ジャッジ時間 | 2,073 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 41 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define RREP(i,s,e) for (i = s; i >= e; i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 100000000
typedef long long ll;
int main() {
int i, n, mx, cnt;
int a[100000];
cin >> n;
rep (i,n) cin >> a[i];
mx = n;
cnt = 0;
rrep (i,n) {
if (a[i] == mx) {
cnt++;
mx--;
}
}
cout << n-cnt << endl;
return 0;
}
h_noson