Submission #1081806

#TimeUsernameProblemLanguageResultExecution timeMemory
1081806jer033Radio Towers (IOI22_towers)C++17
4 / 100
673 ms1368 KiB
#include "towers.h" #include <vector> #include <bits/stdc++.h> using namespace std; vector<int> H; int N; int K; void init(int n, std::vector<int> h) { H = h; N = n; int ma = -1; int bes = -1; for (int i=0; i<n; i++) { if (h[i] > ma) { ma = h[i]; bes = i; } } K = bes; } int max_towers(int L, int R, int D) { if ((L<K) and (K<R) and ((H[K]-H[L])>=D) and (((H[K]-H[R])>=D))) return 2; 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...