Submission #1068633

#TimeUsernameProblemLanguageResultExecution timeMemory
1068633UnforgettableplRadio Towers (IOI22_towers)C++17
4 / 100
711 ms1600 KiB
#include "towers.h" #include <bits/stdc++.h> using namespace std; namespace { vector<int> H; int mid; } void init(int N,vector<int> H){ H.emplace(H.begin(),0); H.emplace(H.end(),0); ::H = H; for(int i=1;i<=N;i++)if(H[i]>H[i-1] and H[i]>H[i+1])mid=i; } int max_towers(int L,int R,int D){ L++;R++; if(R<mid or mid<L)return 1; if(max(H[L],H[R])+D<=H[mid])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...