#include "ricehub.h"
#include "iostream"
#include "vector"
#include "map"
#include "math.h"
#include "string"
#include "algorithm"
#include "set"
#include <iterator>
#include <string.h>
#include <queue>
#include <list>
using namespace std;
typedef long long ll ;
const ll M = 998244353 ;
const ll oo = 1e13 ;
int cost[100010];
int besthub(int R, int L, int X[], long long B){
int ans = 1 ;
for(int i = 1 ; i < R ; ++i){
cost[i] = X[i] - X[i - 1] ;
}
int co = 1 ;
ll c = 0 ;
for(int i = 0 ; i < R - 1 ; ++i){
c += cost[i];
if(c > B){
ans = max(ans , co);
c = cost[i] ;
co = 1 ;
if(c > B){
ans = max(ans , co);
c = 0 ;
co = 0 ;
}
}
co++;
}
ans = max(ans , co);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
380 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
504 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |