# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
846947 | 2023-09-08T17:55:45 Z | SUNWOOOOOOOO | Financial Report (JOI21_financial) | C++17 | 187 ms | 392532 KB |
#include <bits/stdc++.h> using namespace std; const int mxN = 7005; int n, d, A[mxN], dp1[mxN][mxN], dp2[mxN][mxN]; // len, dist vector <int> va; int main() { memset(dp1, -1, sizeof dp1); scanf("%d %d", &n, &d); for (int i = 1; i <= n; i++) { scanf("%d", &A[i]); va.push_back(A[i]); } sort(va.begin(), va.end()); va.erase(unique(va.begin(), va.end()), va.end()); for (int i = 1; i <= n; i++) A[i] = lower_bound(va.begin(), va.end(), A[i]) - va.begin() + 1; int ans = 0; // for (int i = 1; i <= n; i++){ // dp1[i][A[i]] = 1, dp2[i][A[i]] = 1; // if (dp1[i - 1][A[i]] != -1 && dp2[i - 1][A[i]] <= d) dp1[i][A[i]] = dp1[i - 1][A[i]]; // for (int j = 1; j < A[i]; j++){ // if (dp1[i - 1][j] == -1 || dp2[i - 1][j] > d) continue; // dp1[i][j] = dp1[i - 1][j]; // dp2[i][j] = dp2[i - 1][j] + 1; // dp1[i][A[i]] = max(dp1[i][A[i]], dp1[i - 1][j] + 1); // } // for (int j = A[i] + 1; j <= n; j++){ // if (dp1[i - 1][j] == -1) continue; // dp1[i][j] = dp1[i - 1][j]; // dp2[i][j] = 1; // } // for (int j = 1; j <= n; j++) ans = max(ans, dp1[i][j]); // } printf("%d\n", ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 193368 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 193368 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 193368 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 173 ms | 392532 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 187 ms | 392216 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 193368 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |