hiho week 69 register

Ended

Participants:406

Verdict:Accepted
Score:100 / 100
Submitted:2015-10-25 19:55:32

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 <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
using namespace std;
int e[100010],n,k;
bool yes(int key)
{
    int hi=0,ho=0,v=0;
    for(int i=0;i<n;i++){
        v+=key;
        if(v<=e[i]){
            hi++;
            v=0;
        }
        else{
            ho++;
            v-=e[i];
        }
    }
    if(hi>=ho) return false;
    else return true;
}
int main()
{
    //freopen("in.txt","r",stdin);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX