Submission #992577

#TimeUsernameProblemLanguageResultExecution timeMemory
992577MrDebooRice Hub (IOI11_ricehub)C++17
0 / 100
2 ms600 KiB
#include "ricehub.h" #include "bits/stdc++.h" using namespace std; int besthub(int r, int l, int x[], long long b){ deque<pair<long long,long>>dq; int ans=0; for(int i=0;i<r;i++){ dq.push_back({(long long)x[i]+(dq.empty()?0ll:dq.back().first),x[i]}); while(dq.size()>1&&((dq.back().first-(dq[0].first-dq[0].second))-dq[dq.size()/2].second*(dq.size()-dq.size()/2))+(dq[dq.size()/2].second*(dq.size()/2)-(dq[dq.size()/2-1].first-(dq[0].first-dq[0].second)))>b)dq.pop_front(); ans=max(ans,(int)dq.size()); } return ans; }

Compilation message (stderr)

ricehub.cpp: In function 'int besthub(int, int, int*, long long int)':
ricehub.cpp:9:213: warning: comparison of integer expressions of different signedness: 'long long unsigned int' and 'long long int' [-Wsign-compare]
    9 |         while(dq.size()>1&&((dq.back().first-(dq[0].first-dq[0].second))-dq[dq.size()/2].second*(dq.size()-dq.size()/2))+(dq[dq.size()/2].second*(dq.size()/2)-(dq[dq.size()/2-1].first-(dq[0].first-dq[0].second)))>b)dq.pop_front();
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...