hiho week 69 register

Ended

Participants:406

Verdict:Accepted
Score:100 / 100
Submitted:2015-10-31 12:08:31

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 <stdio.h>
#include <iostream>
using namespace std;
int d[100005];
int N, K;
int getScore(int T)
{
    int rest = 0, score = 0;
    for (int i = 1; i <= N; i++)
    {
        rest = rest + T;
        if (rest > d[i])
        {
            score += 1;
            rest -= d[i];
        }
        else
            rest = 0;
    }
    return score;
}
int getT(int low, int high)
{
    int yuzhi = N/2;
    int mid;
    while (low  < high)
    {
        mid = (high + low) / 2;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX