# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1122329 | Username_taken12 | Giraffes (JOI22_giraffes) | C++17 | 1 ms | 340 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;
int main() {
int N;
cin>>N;
vector<int> arr;
for(int i=0; i<N; i++)
{
int t; cin>>t;
arr.push_back(--t);
}
/*for(int i=0; i<N; i++)
cout<<arr[i]<<' ';
cout<<endl<<endl;*/
vector<vector<int>> dp;
for(int i=0; i<=N; i++){
vector<int> t;
for(int j=0; j<=N; j++)
t.push_back(0);
dp.push_back(t);
}
for(int s=0; s<N; s++){
for(int i=0; i<=s; i++)
{
if(arr[i]==s)
dp[i+1][s-i]=max(dp[i+1][s-i], dp[i][s-i]+1);
else
# | 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... |