Submission #136610

# Submission time Handle Problem Language Result Execution time Memory
136610 2019-07-25T18:34:55 Z miguel Rice Hub (IOI11_ricehub) C++14
58 / 100
35 ms 2560 KB
#include<bits/stdc++.h>
#include<ricehub.h>
using namespace std;
#define pb push_back
#define dbg(x) cout << #x << '=' << x << '\n';
#define ll long long
#define x first
#define y second
#define pi pair <int, int>
#define pii pair <int, pi>
#define vi vector <int>
const ll mod = 998244353;
 
int besthub(int n, int l, int x[], ll b){
  	if(b==0) return 0;
    ll s[n+1];
    int ans=0;
    s[0]=1LL*x[0];
    s[n]=1000000000000000000;
    for(int i=1; i<n; i++) s[i]=s[i-1]+x[i];
    for(int i=0; i<n; i++){
        int l=0, r=n-i;
        while(r-l>1){
            int mid=(l+r)>>1;
            int start=i, e=i+mid;
            int xd=(start+e)/2;
            if((1LL*x[xd]*(2*xd-start-e)-1LL*s[xd-1]+1LL*s[start-1]+1LL*s[e]-1LL*s[xd])<=b) l=mid;
            else r=mid;
        }
        ans=max(ans, l);
    }
    return ans+1;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Incorrect 2 ms 376 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 252 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 256 KB Output is correct
16 Correct 2 ms 256 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 4 ms 376 KB Output is correct
22 Correct 3 ms 376 KB Output is correct
23 Correct 3 ms 376 KB Output is correct
24 Correct 3 ms 376 KB Output is correct
25 Correct 3 ms 376 KB Output is correct
26 Correct 3 ms 376 KB Output is correct
27 Correct 3 ms 376 KB Output is correct
28 Correct 3 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 760 KB Output is correct
2 Correct 7 ms 760 KB Output is correct
3 Correct 33 ms 2560 KB Output is correct
4 Correct 33 ms 2524 KB Output is correct
5 Correct 15 ms 1272 KB Output is correct
6 Correct 15 ms 1308 KB Output is correct
7 Correct 31 ms 2296 KB Output is correct
8 Correct 32 ms 2296 KB Output is correct
9 Correct 15 ms 1144 KB Output is correct
10 Correct 15 ms 1272 KB Output is correct
11 Correct 35 ms 2552 KB Output is correct
12 Correct 35 ms 2552 KB Output is correct
13 Correct 16 ms 1272 KB Output is correct
14 Correct 17 ms 1272 KB Output is correct
15 Correct 26 ms 2040 KB Output is correct
16 Correct 26 ms 2040 KB Output is correct
17 Correct 33 ms 2428 KB Output is correct
18 Correct 31 ms 2296 KB Output is correct
19 Correct 33 ms 2424 KB Output is correct
20 Correct 33 ms 2424 KB Output is correct