Submission #552406

# Submission time Handle Problem Language Result Execution time Memory
552406 2022-04-23T06:11:06 Z Wasrek Rice Hub (IOI11_ricehub) C++14
0 / 100
4 ms 512 KB
#include<bits/stdc++.h>
// #include "grader.cpp"
#include "ricehub.h"
using namespace std;
int qs[100010];
int besthub(int R, int L, int X[], long long B)
{
  int now=0,temp,ans=1;
  for(int i=0, j=0;i<R && j<R;i++){
    if(i!=1) now-=X[(i+j)>>1]-X[i-1];
    if(j<i)j=i,now=0;
    while(j<(R-1)){//move j
      temp=(X[j+1]-X[(i+j+1)>>1]);
      if(now+temp<=B) j++,now+=temp;
      else break;
    }
    // printf("%d %d\n",i,j);
    ans=max(ans,j-i+1);
    if(j==R-1) break;
  }                        
  return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 340 KB Output is correct
2 Incorrect 3 ms 512 KB Output isn't correct
3 Halted 0 ms 0 KB -