hiho week 193 register

Ended

Participants:256

Verdict:Accepted
Score:100 / 100
Submitted:2018-03-13 20:55: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 <queue>
#include <algorithm>
using namespace std;
int data[1005];
int N, M, L;
bool Check(queue<int> q, int count)
{
    while ((q.empty() == false) && (count>0))
    {
        int start = q.front();
        while ((q.empty() == false) && (q.front() < start + L))
            q.pop();
        count--;
    }
    if (q.empty() == true)
        return true;
    else
        return false;
}
bool CheckFirst(int num)
{
    queue<int> q;
    for (int i = 0; i < N; i++)
    {
        if (data[i] < num)
            q.push(i);
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX