Submission #1054081

#TimeUsernameProblemLanguageResultExecution timeMemory
1054081GrayRadio Towers (IOI22_towers)C++17
14 / 100
572 ms1968 KiB
#include "towers.h" #include <algorithm> #include <vector> #include <iostream> #define ll int #define ff first #define ss second #define ln "\n" using namespace std; vector<ll> pref, a; ll n; vector<bool> big(n); void init(int N, std::vector<int> H) { a=H; n=N; pref.clear(); pref.resize(n); big.clear(); big.resize(n); for (ll i=1; i<n; i++){ pref[i]=pref[i-1]; if (i+1<n and i-1>=0 and a[i]>a[i-1] and a[i]>a[i+1]) pref[i]++; } } // smallt -> // bigt -> int max_towers(int L, int R, int D) { return max(1, (R-1>=0?pref[R-1]:0)-pref[L]+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...