POJ 2763 Housewife Wind
题目链接
就树链剖分。。不过这题坑vector啊!, vector居然超时
代码:
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
#define lson(x) ((x<<1)+1)
#define rson(x) ((x<<1)+2)
typedef long long ll;
const int N = 100005;
int dep[N], sz[N], son[N], fa[N], top[N], id[N], idx, val[N];
int n, q, s;
struct Edge {
int u, v, val;
void read() {
scanf("%d%d%d", &u, &v, &va......
阅读全文