Submission #787117

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7871172023-07-18 20:35:47alexander707070Radio Towers (IOI22_towers)C++17
56 / 100
4022 ms7128 KiB
#include<bits/stdc++.h>
#define MAXN 100007
using namespace std;
int n,h[MAXN],maxh,num,delta,from[MAXN],to[MAXN],border;
int dp[MAXN],ans,pref[MAXN],se,te;
pair<int,int> tree[4*MAXN];
int mins[4*MAXN];
pair<int,int> combine(pair<int,int> fr,pair<int,int> sc){
if(fr.first>sc.first)return fr;
return sc;
}
void build(int v,int l,int r){
if(l==r){
tree[v]={h[l],l};
mins[v]=h[l];
}else{
int tt=(l+r)/2;
build(2*v,l,tt);
build(2*v+1,tt+1,r);
tree[v]=combine(tree[2*v],tree[2*v+1]);
mins[v]=min(mins[2*v],mins[2*v+1]);
}
}
pair<int,int> best(int v,int l,int r,int ll,int rr){
if(ll>rr)return {-1,0};
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:155:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  155 |         if(se==poss.size())se=R+1;
      |            ~~^~~~~~~~~~~~~
towers.cpp:172:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  172 |         if(r!=lt.size() and to[lt[r]]<se){
      |            ~^~~~~~~~~~~
#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...