Submission #1122329

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11223292024-11-29 18:24:58Username_taken12Giraffes (JOI22_giraffes)C++17
0 / 100
1 ms340 KiB
#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
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...