#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;
int solve(const vector<int> &A) {
const int N = A.size();
int best = 0;
vector<int> dp(N, 0);
for (int i = 1; i < N; ++i) {
for (int j = 0; j < i; ++j) {
if (A[i] < A[j]) {
dp[i] = max(dp[i], 1 + dp[j]);
}
}
best = max(best, dp[i]);
}
return best;
}
vector<int> countScans(vector<int> A, vector<int> X, vector<int> V) {
int Q = X.size();
vector<int> answer(Q);
for (int j = 0; j < Q; j++) {
A[X[j]] = V[j];
answer[j] = solve(A);
}
return answer;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
239 ms |
324 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
239 ms |
324 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9025 ms |
588 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
239 ms |
324 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |