Submission #582435

# Submission time Handle Problem Language Result Execution time Memory
582435 2022-06-23T18:35:09 Z Mystic03 Rice Hub (IOI11_ricehub) C++17
0 / 100
2 ms 456 KB
#include <vector>
#include <iostream>

#define int long long
using namespace std;
int32_t besthub(int32_t n, int32_t L, int32_t X[], long long B){
	
	int from = 0;
	int to = 0;
	
	long long cost = 0;
	int res = 1;
	while (true) {
		int currRange = to - from + 1;
		to++;
		if (to >= n) break;

		int newDist = X[to] - X[to - 1];
		cost += (long long)currRange * newDist;

		while (cost > B) {
			cost -= X[to] - X[from];
			from++;
		}

		res = max(res, to - from + 1);
	}
	return res;
}
# 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 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 316 KB Output is correct
4 Incorrect 1 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 456 KB Output isn't correct
2 Halted 0 ms 0 KB -