Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
73662 | Agnes | 递增 | C++ | 解答错误 | 9 | 2 MS | 308 KB | 583 | 2023-04-08 10:39:41 |
#include <iostream> using namespace std; int a[100005], b[100005]; int main() { int t, n, c = 0, l, r, mid; cin >> t; int s = t; while (t--) { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; for (int i = 1; i <= n; i++) { if (a[i] > b[c]) { c++; b[c] = a[i]; } else { l = 1; r = c; while (l < r) { mid = (l + r) / 2; if (a[i] <= b[mid]) r = mid; else l = mid + 1; } b[l] = a[i]; } } cout << "Case #" << s - t << ":" << endl << n - c << endl; } return 0; }