Submission #1077247

#TimeUsernameProblemLanguageResultExecution timeMemory
1077247pccRadio Towers (IOI22_towers)C++17
4 / 100
625 ms1604 KiB
#include "towers.h" #include <vector> #include <bits/stdc++.h> using namespace std; const int mxn = 1e5+10; int mx; int N; vector<int> H; void init(int NN, std::vector<int> HH) { H = HH; N = NN; mx = max_element(H.begin(),H.end())-H.begin(); return; } int max_towers(int L, int R, int D) { if(L>=mx||mx>=R)return 1; else if(min(H[mx]-H[L],H[mx]-H[R])<D)return 1; else return 2; }
#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...