Submission #625457

#TimeUsernameProblemLanguageResultExecution timeMemory
625457model_codeRadio Towers (IOI22_towers)C++17
14 / 100
1391 ms1856 KiB
// incorrect/solution-d-equals-one.cpp #include "towers.h" #include <bits/stdc++.h> using namespace std; int N; vector<int> H; vector<int> pre_sum; void init(int _N, std::vector<int> _H) { N = _N; H = _H; pre_sum.resize(N); for (int i = 1; i < N - 1; ++i) { pre_sum[i] = pre_sum[i - 1]; if (H[i] < min(H[i - 1], H[i + 1])) { pre_sum[i] += 1; } } } int max_towers(int L, int R, int D) { if (L == R) { return 1; } int answer = pre_sum[R - 1] - pre_sum[L]; if (H[L] < H[L + 1]) { ++answer; } if (H[R] < H[R - 1]) { ++answer; } return answer; }
#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...