Submission #49751

# Submission time Handle Problem Language Result Execution time Memory
49751 2018-06-02T17:45:46 Z gs13105 Rice Hub (IOI11_ricehub) C++17
0 / 100
23 ms 4572 KB
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <iterator>
#include "ricehub.h"

using namespace std;

int besthub(int R, int L, int X[], long long B)
{
    int p = 0, q = 0, res = 0;
    long long c = 0;
    for(int i = 0; i < R; i++)
    {
        if(i)
            c += 1LL * ((i - p) - (q - i)) * (X[i] - X[i - 1]);

        while(q < R && (X[q] - X[i] <= X[i] - X[p] || c + X[q] - X[i] <= B))
            c += X[q++] - X[i];

        while(c > B)
            c -= X[i] - X[p++];

        res = max(res, q - p);
    }
    return res;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 624 KB Output is correct
3 Incorrect 2 ms 624 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 764 KB Output is correct
2 Correct 2 ms 800 KB Output is correct
3 Correct 2 ms 848 KB Output is correct
4 Correct 2 ms 940 KB Output is correct
5 Correct 2 ms 1000 KB Output is correct
6 Correct 2 ms 1000 KB Output is correct
7 Correct 3 ms 1000 KB Output is correct
8 Correct 2 ms 1000 KB Output is correct
9 Correct 2 ms 1028 KB Output is correct
10 Correct 2 ms 1028 KB Output is correct
11 Correct 2 ms 1028 KB Output is correct
12 Correct 2 ms 1028 KB Output is correct
13 Correct 3 ms 1048 KB Output is correct
14 Correct 2 ms 1048 KB Output is correct
15 Correct 3 ms 1048 KB Output is correct
16 Correct 2 ms 1048 KB Output is correct
17 Correct 3 ms 1048 KB Output is correct
18 Correct 2 ms 1048 KB Output is correct
19 Correct 2 ms 1080 KB Output is correct
20 Correct 2 ms 1080 KB Output is correct
21 Correct 3 ms 1080 KB Output is correct
22 Correct 3 ms 1080 KB Output is correct
23 Correct 2 ms 1080 KB Output is correct
24 Correct 2 ms 1096 KB Output is correct
25 Correct 3 ms 1096 KB Output is correct
26 Correct 2 ms 1104 KB Output is correct
27 Incorrect 2 ms 1108 KB Output isn't correct
28 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1112 KB Output is correct
2 Correct 2 ms 1116 KB Output is correct
3 Correct 3 ms 1120 KB Output is correct
4 Correct 2 ms 1128 KB Output is correct
5 Correct 2 ms 1128 KB Output is correct
6 Correct 2 ms 1128 KB Output is correct
7 Correct 2 ms 1160 KB Output is correct
8 Correct 3 ms 1184 KB Output is correct
9 Correct 3 ms 1192 KB Output is correct
10 Correct 2 ms 1192 KB Output is correct
11 Correct 3 ms 1200 KB Output is correct
12 Correct 2 ms 1228 KB Output is correct
13 Correct 3 ms 1240 KB Output is correct
14 Correct 3 ms 1240 KB Output is correct
15 Correct 3 ms 1240 KB Output is correct
16 Correct 14 ms 1256 KB Output is correct
17 Correct 3 ms 1260 KB Output is correct
18 Incorrect 3 ms 1260 KB Output isn't correct
19 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 1404 KB Output is correct
2 Correct 5 ms 1540 KB Output is correct
3 Correct 23 ms 2932 KB Output is correct
4 Correct 22 ms 4020 KB Output is correct
5 Runtime error 15 ms 4572 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Halted 0 ms 0 KB -