Submission #636277

#TimeUsernameProblemLanguageResultExecution timeMemory
636277mosiashvililukaRadio Towers (IOI22_towers)C++17
14 / 100
937 ms2236 KiB
#include<bits/stdc++.h> #include "towers.h" using namespace std; int a,b,c,d,e,i,j,ii,jj,zx,xc,f[100009],jm[100009],L,R,D,F[100009]; void init(int NN, std::vector<int> HH) { a=NN; for(i=1; i<=a; i++) f[i]=HH[i-1]; f[0]=1000000009;f[a+1]=f[0]; for(i=1; i<=a; i++){ jm[i]=jm[i-1]; if(f[i]<f[i-1]&&f[i]<f[i+1]){ jm[i]++;F[i]=1; } } } int max_towers(int LL, int RR, int DD) { L=LL+1;R=RR+1;D=DD; zx=jm[R]-jm[L-1]; if(F[L]==0&&f[L]<f[L+1]) zx++; if(L!=R&&F[R]==0&&f[R]<f[R-1]) zx++; zx=max(zx,1); return zx; }
#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...