Lang:G++
Edit12345678910111213141516171819202122232425262728293031#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) {