hiho week 69 register

Ended

Participants:406

Verdict:Accepted
Score:100 / 100
Submitted:2015-10-26 19:34:18

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 <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>
using namespace std;
const int N = 100000;
int a[N];
int n, k;
int getScore(int t)
{
    int res = 0;
    int rest = 0;
    for(int i = 0; i < n; ++i){
        rest = rest + t;
        if(rest > a[i]) {
            res++;
            rest = rest-a[i];
        }else 
            rest = 0;
    }
    return res;
}
int main()
{
    while(cin >> n >> k){
        for(int i = 0; i < n; ++i)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX