結果
問題 |
No.365 ジェンガソート
|
ユーザー |
![]() |
提出日時 | 2016-04-29 22:53:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 344 bytes |
コンパイル時間 | 370 ms |
コンパイル使用メモリ | 60,848 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-04 18:33:07 |
合計ジャッジ時間 | 1,826 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 41 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main() { int N; vector<int> a; cin >> N; int res = N; for (int i = 0, x, left; i < N; ++i) { cin >> x; a.push_back(x); if (i == 0) left = x; else if (x == left + 1) ++left, --res; else if (x > left) left = x, res = N; } cout << res << endl; return 0; }