結果
問題 |
No.365 ジェンガソート
|
ユーザー |
|
提出日時 | 2020-05-19 21:16:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 312 bytes |
コンパイル時間 | 1,594 ms |
コンパイル使用メモリ | 168,956 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-01 23:02:35 |
合計ジャッジ時間 | 2,623 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 38 |
ソースコード
#include <bits/stdc++.h> using namespace std; using lint = long long; const int INF = 1e9; signed main(){ int n; cin >> n; vector<int> a(n), dp(n, INF); for(int i = 0; i < n; i++) scanf("%d", &a[i]); int ans = 0; for(int i = n - 1; i >= 0; i--){ if(a[i] == ans) ans--; } cout << ans << endl; }