Submission #735065

#TimeUsernameProblemLanguageResultExecution timeMemory
735065math_rabbit_1028Radio Towers (IOI22_towers)C++17
4 / 100
1091 ms1684 KiB
#include "towers.h" #include <vector> int k; std::vector<int> arr; void init(int N, std::vector<int> H) { for (int i = 1; i < N; i++) { if (H[i] < H[i - 1]) { k = i - 1; break; } } for (int i = 0; i < N; i++) arr.push_back(H[i]); } int max_towers(int L, int R, int D) { if (L >= k || R <= k) return 1; else { if (arr[k] - arr[L] >= D && arr[k] - arr[R] >= D) return 2; else return 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...