Submission #164829

# Submission time Handle Problem Language Result Execution time Memory
164829 2019-11-23T16:13:34 Z arnold518 Rice Hub (IOI11_ricehub) C++14
0 / 100
5 ms 508 KB
#include "ricehub.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int R, L, *X, ans;
ll B;

int besthub(int _R, int _L, int *_X, ll _B)
{
    int i, j;
    R=_R; L=_L; X=_X; B=_B;

    ll S=0;
    for(i=0, j=0; i<R; i++)
    {
        for(; j<R && S<=B; j++) S+=X[j]-X[i+j>>1];
        ans=max(ans, j-i);
    }
    return ans;
}

Compilation message

ricehub.cpp: In function 'int besthub(int, int, int*, ll)':
ricehub.cpp:20:44: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
         for(; j<R && S<=B; j++) S+=X[j]-X[i+j>>1];
                                           ~^~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 508 KB Output isn't correct
2 Halted 0 ms 0 KB -