結果
問題 | No.365 ジェンガソート |
ユーザー |
|
提出日時 | 2016-04-29 22:31:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 449 bytes |
コンパイル時間 | 680 ms |
コンパイル使用メモリ | 71,280 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 01:39:01 |
合計ジャッジ時間 | 1,940 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 41 |
ソースコード
#include <iostream>#include <algorithm>#include <vector>using ll = long long int;int main(){std::ios::sync_with_stdio(false);std::cin.tie(0);int n;std::cin >> n;int maxN = n;std::vector<int> a(n);for(auto& i : a){std::cin >> i;}for(auto rit=a.rbegin(); rit!=a.rend(); ++rit){if(*rit==maxN){--maxN;}}std::cout << maxN << "\n";return 0;}