Submission #418227

# Submission time Handle Problem Language Result Execution time Memory
418227 2021-06-05T08:31:32 Z temurbek_khujaev Rice Hub (IOI11_ricehub) C++17
0 / 100
1000 ms 332 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;
    for (int i = 0; i < R; i++) {
        long long b = 0;
        for (int j = i; j >= 0; j--) {
            b += X[i] - X[j];
            for (int k = i; k < R; k++) {
                b += X[k] - X[i];
                if ( b <= B) {
                    ans = max(ans, k - j + 1);
                }
            }
        }
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1092 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -