Submission #1073504

#TimeUsernameProblemLanguageResultExecution timeMemory
1073504fv3Radio Towers (IOI22_towers)C++17
4 / 100
683 ms1368 KiB
#include "towers.h" #include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; int N; vector<int> H; int K = 0; void init(int N_, vector<int> H_) { N = N_; H = H_; int mx = 0; for (int i = 0; i < N; i++) { if (H[i] > mx) { mx = H[i]; K = i; } } } int max_towers(int L, int R, int D) { if (L < K && K < R) { if (H[K] - max(H[L], H[R]) >= D) return 2; return 1; } 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...