Submission #1056074

#TimeUsernameProblemLanguageResultExecution timeMemory
1056074MercubytheFirstRadio Towers (IOI22_towers)C++17
0 / 100
433 ms1112 KiB
#include "towers.h" #include <bits/stdc++.h> using namespace std; using ll = long long; ll k = -1; void init(int N, std::vector<int> H) { for(int i = 0; i + 1 < N; ++i) { if(H[i] > H[i + 1]) { k = i; break; } } if(k == -1) { k = N - 1; } } int max_towers(int L, int R, int D) { if(k <= L or R <= k) { return 0; } ll ans = (k - L) * (R - k); assert(ans >= 0); return ans; }
#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...