結果
問題 | No.365 ジェンガソート |
ユーザー |
![]() |
提出日時 | 2016-04-29 23:04:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 277 bytes |
コンパイル時間 | 1,233 ms |
コンパイル使用メモリ | 157,784 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 01:45:15 |
合計ジャッジ時間 | 2,905 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 41 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long int64;int main(){int N, A[100000];cin >> N;for(int i = 0; i < N; i++) {cin >> A[i];}int ptr = N;for(int i = N - 1; i >= 0; i--) {if(A[i] == ptr) --ptr;}cout << ptr << endl;}