hiho week 69 register

Ended

Participants:406

Verdict:Accepted
Score:100 / 100
Submitted:2015-10-30 18:27:52

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <cstdio>
using namespace std;
int d[100005],n;
int get_score(int T)
{
    int score = 0;
    int rest = 0;
    for(int i=0; i<n; i++)
    {
        rest += T;
        if(rest <= d[i])
        {
            rest = 0;
        }
        else
        {
            rest -= d[i];
            ++score;
        }
    }
    return score;
}
static int binSearch(int lo, int hi)
{
    while(lo<hi)
    {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX