結果
問題 | No.365 ジェンガソート |
ユーザー |
![]() |
提出日時 | 2016-04-29 22:29:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 356 bytes |
コンパイル時間 | 1,738 ms |
コンパイル使用メモリ | 167,808 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 01:38:55 |
合計ジャッジ時間 | 3,323 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 41 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define int long long#define REP(i,n) for(int i = 0; i < (int)(n); ++i)#define DEBUG(x) cerr << #x << " = " << x << endlsigned main() {int N; cin >> N;vector<int> A(N);REP(i,N) cin >> A[i];int num = N;for(int i = N - 1; i >= 0; --i) {if(A[i] == num) num--;}cout << num << endl;}