| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1069709 | danikoynov | Financial Report (JOI21_financial) | C++14 | 4067 ms | 5908 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
void speed()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
}
const int MAXN = 3e5 + 10;
int n, a[MAXN], d, dp[MAXN];
void solve()
{
cin >> n >> d;
for (int i = 1; i <= n; i ++)
{
cin >> a[i];
}
int res = 0;
for (int i = 1; i <= n; i ++)
{
dp[i] = max(dp[i], 1);
int ls = i;
for (int j = i + 1; j <= n; j ++)
{
if (a[j] > a[i] && j - ls > d)
break;
if (a[j] > a[i])
{
//cout << i << " : " << j << endl;
dp[j] = max(dp[j], dp[i] + 1);
}
else
{
if (j == n)
res = max(res, dp[i]);
ls = j;
}
}
}
res = max(res, dp[n]);
cout << res << endl;
}
int main()
{
solve();
return 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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
