2023年2月16日
摘要: 在边权都为1的 树上加1条或者2条边(边权为1) ,从1出发遍历所有点,使得总路程最短 #include <bits/stdc++.h> using namespace std ; const int N=1e5+2,M=2*N; int nxt[M],w[M],go[M],hd[N],all=1; 阅读全文
posted @ 2023-02-16 21:33 towboat 阅读(23) 评论(0) 推荐(0)
摘要: struct Q{ int q[N],hh=1,tt=0; void push(int x){ q[++tt]=x; } void pop(){hh++;} bool empty(){return hh<=tt?0:1;} int front(){ return q[hh]; } }; 阅读全文
posted @ 2023-02-15 23:59 towboat 阅读(22) 评论(0) 推荐(0)