Submission #418224

# Submission time Handle Problem Language Result Execution time Memory
418224 2021-06-05T08:30:48 Z temurbek_khujaev Rice Hub (IOI11_ricehub) C++17
0 / 100
1000 ms 444 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 1 ms 204 KB Output is correct
2 Incorrect 1 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1074 ms 444 KB Time limit exceeded
2 Halted 0 ms 0 KB -