Submission #651012

#TimeUsernameProblemLanguageResultExecution timeMemory
651012NaimSSRadio Towers (IOI22_towers)C++17
0 / 100
675 ms1744 KiB
#include "towers.h" #include <bits/stdc++.h> #define pb push_back using namespace std; #include <vector> const int N = 100100; int cnt[N]; int h[N]; vector<int> pos; #define pico ahiusuhashuis vector<int> pico; void init(int N, std::vector<int> H) { for(int i=0;i<N;i++)h[i] = H[i]; for(int i=0;i<N;i++){ int l = (i == 0 || H[i] < H[i-1]); int r = (i == N-1 || H[i] < H[i+1]); if(l && r){ cnt[i]++; } if(i)cnt[i]+=cnt[i-1]; } } int max_towers(int L, int R, int D) { if(L==R)return 1; return max(1,cnt[R]-(L>0?cnt[L-1]:0)); }
#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...