Submission #667091

#TimeUsernameProblemLanguageResultExecution timeMemory
667091tatyamRadio Towers (IOI22_towers)C++17
14 / 100
889 ms1888 KiB
#include <bits/stdc++.h> using namespace std; int N; vector<int> H; vector<int> S; void init(int N, vector<int> H) { ::N = N; ::H = H; S.resize(N); for(int i = 1; i + 1 < N; i++) S[i] = S[i - 1] + (H[i - 1] < H[i] && H[i] > H[i + 1]); } int max_towers(int L, int R, int D) { assert(D == 1); if(L == R) return 1; return S[R - 1] - S[L] + 1; }
#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...