Submission #563294

# Submission time Handle Problem Language Result Execution time Memory
563294 2022-05-16T19:39:41 Z 1ne Rice Hub (IOI11_ricehub) C++14
0 / 100
2 ms 340 KB
#include "ricehub.h"
#include<bits/stdc++.h>
using namespace std;
int besthub(int R, int L, int X[], long long B)
{
  int ans = 0;
  int l = 0,r = 0;
  long long cost = B;
  while(l<=r && r < R){
	  if (r + 1 < R && X[r + 1] - X[r] <= cost){
		  cost-=X[r + 1] - X[r];
		  ++r;
	  } 
	  else if (l + 1<=r) {
		  cost+=X[l + 1] - X[l];
		  ++l;
	  }
	  else {
		l++;
		r = l;
		cost = B;
	  }
	  ans = max(ans,r - l + 1);
  }
  return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 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 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -