hiho week 90 register

Ended

Participants:743

Verdict:Accepted
Score:100 / 100
Submitted:2016-03-22 13:21:07

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 "cstring"
#include "algorithm"
using namespace std;
struct Event {
    int t, n, x;
    Event(int t_, int n_, int x_) :t(t_), n(n_), x(x_) { }
};
bool operator < (const Event & a, const Event & b)
{
    return (a.t < b.t) || (a.t == b.t && a.x < b.x);
}
int kase, T, L, R, N, Q;
int t, l, n, d;
int lane[2][1050];
vector <Event> eventSequence[2];
int main() {
    scanf("%d", &kase);
    while (kase--) {
        scanf("%d%d%d%d%d", &T, &L, &R, &N, &Q);
        int timePoint = T, dir = 0, point[2] = { 0, 0 };
        eventSequence[0].clear(); eventSequence[1].clear();
        memset(lane, 0, sizeof(lane));
        for (int i = 0; i < Q; ++i) {
            scanf("%d%d%d%d", &t, &l, &n, &d);
            if (l < L) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX