Submission #832706

# Submission time Handle Problem Language Result Execution time Memory
832706 2023-08-21T14:05:21 Z Sohsoh84 Bubble Sort 2 (JOI18_bubblesort2) C++17
0 / 100
9000 ms 968 KB
#include "bubblesort2.h"
#include <bits/stdc++.h>

using namespace std;

const int MAXN = 5e5 + 10;

int dp[MAXN];

vector<int> countScans(vector<int> A, vector<int> X, vector<int> V){
	int q = X.size(), n = A.size();
	vector<int> ans;
	for (int i = 0; i < q; i++) {
		A[X[i]] = V[i];
		
		int f = 0;
		for (int i = 0; i < n; i++) {
			dp[i] = 1;
			for (int j = 0; j < i; j++) {
				if (A[j] > A[i])
					dp[i] = max(dp[i], dp[j] + 1);
				
			}

			f = max(f, dp[i]);
		}

		ans.push_back(f - 1);

	}

	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 139 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 139 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9074 ms 968 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 139 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -