結果
問題 |
No.1425 Yet Another Cyclic Shifts Sorting
|
ユーザー |
![]() |
提出日時 | 2021-03-12 21:42:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 523 bytes |
コンパイル時間 | 798 ms |
コンパイル使用メモリ | 82,852 KB |
実行使用メモリ | 7,116 KB |
最終ジャッジ日時 | 2024-10-14 11:58:41 |
合計ジャッジ時間 | 4,034 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 31 |
ソースコード
#include <iostream> #include <map> #include <cmath> #include <queue> #include <vector> #include <string> #include <algorithm> #include <functional> using namespace std; long long N, X[1 << 18]; long long B[1 << 18], cnt; int main() { cin >> N; for (int i = 0; i < N; i++) cin >> X[i]; for (int i = 0; i < N; i++) X[i] = (1000000LL * X[i]) + 1LL * i; for (int i = 0; i < N; i++) { int pos1 = lower_bound(B, B + cnt, X[i] + 1) - B; if (pos1 == cnt) cnt++; B[pos1] = X[i]; } cout << N - cnt << endl; return 0; }