Submission #1068647

#TimeUsernameProblemLanguageResultExecution timeMemory
1068647UnforgettableplRadio Towers (IOI22_towers)C++17
11 / 100
4062 ms1736 KiB
#include "towers.h" #include <bits/stdc++.h> using namespace std; namespace { vector<int> H; int N; } void init(int N,vector<int> H){ ::H = H; ::N = N; } int max_towers(int L,int R,int D){ vector DP(N,1); for(int i=L;i<=R;i++) { int maxi = 0; for(int j=i-1;j>=L;j--) { if(maxi-D>=H[i] and maxi-D>=H[j])DP[i]=max(DP[i],DP[j]+1); maxi = max(maxi,H[j]); } } return *max_element(DP.begin(),DP.end()); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...