# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
394137 | vishesh312 | K blocks (IZhO14_blocks) | C++17 | 451 ms | 45236 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using ordered_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;
*/
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define sz(x) (int)(x).size()
using ll = long long;
const int mod = 1e9+7;
void solve(int tc) {
int n, k;
cin >> n >> k;
vector<int> v(n+1), prev(n+1);
for (int i = 1; i <= n; ++i) {
cin >> v[i];
int p = i-1;
while (p and v[p] < v[i]) p = prev[p];
prev[i] = p;
}
vector<vector<int>> dp(n+1, vector<int>(k+1, (1<<30)));
dp[0][0] = 0;
vector<int> s(n+1);
for (int j = 1; j <= k; ++j) {
int l = 0;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |