Submission #1076399

#TimeUsernameProblemLanguageResultExecution timeMemory
1076399vjudge1Radio Towers (IOI22_towers)C++17
11 / 100
4065 ms1492 KiB
#include "towers.h" #include <bits/stdc++.h> using namespace std; using vi = vector<int>; int n; vi H; void init(int N0, vi H0) { n = N0; H = H0; } int max_towers(int l, int r, int D) { int re = 1; vi DP(n, 1); for(int i = l; i <= r; ++i) { for(int j = l; j < i; ++j) { int ma = 0; for(int w = j; w <= i; ++w) ma = max(ma, H[w]); if(ma >= D + max(H[i], H[j])) { DP[i] = max(DP[i], DP[j] + 1); re = max(re, DP[i]); } } } return re; }
#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...