Submission #832706

#TimeUsernameProblemLanguageResultExecution timeMemory
832706Sohsoh84Bubble Sort 2 (JOI18_bubblesort2)C++17
0 / 100
9074 ms968 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...