Raisetsu41's Blog

「I will see your face down here real soon.」

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
struct Deque {
int head, tail, n, m, q[MAXN], a[MAXN], p;

Deque(){}
Deque(int n, int m, int head, int tail, int p) : n(n), m(m), head(head), tail(tail), p(p){};

int get(int id) {
int res = a[q[head]];
while (id - q[head] >= m && head <= tail) head++;
while (a[id] <= a[q[tail]] && head <= tail) tail--;
q[++tail] = id;
return res * p;
}

void scan() {
for (int i = 1; i <= n; i++) scanf ("%d", &a[i]), a[i] *= p;
}

}

前言

这是我第一次参加比较大型的比赛,也是我自认为打得最糟糕的一场比赛了,或许是前期模拟赛几起又几落,导致对自己实力概况不太熟悉,一参考心态就紧张的缘故,打pj时智商完全不在线上。
还是应该静下来好好总结一下吧。

Read more »