hiho week 90 register

Ended

Participants:743

Verdict:Accepted
Score:100 / 100
Submitted:2016-03-20 22:47:13

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 <vector>
#include <memory.h>
#include <algorithm>
using namespace std;
struct Event {
    int start;
    int lane;
    int flag;
    Event(int s, int l, int f) : start(s), lane(l), flag(f) {};
};
bool comp(const Event &e1, const Event &e2)
{
    if (e1.start != e2.start)
        return e1.start < e2.start;
    else
        return e1.flag < e2.flag;
}
vector<Event> events[2];
int T, L, R, N, Q;
int people[2][10000];
int MAX_EVENTS;
int work()
{
    int current = T;
    int direction = 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX