版本比较
题解 P5227 【[AHOI2013] 连通图】
正文
增加 7 行删除 7 行
4 行未改动5678991011121332 行未改动4647484950505152535454555657585960616162636465656667686869707172737374757677122 行未改动全部展开4 行未改动共 $k$ 次询问,每次询问给出一个边集。问:删去边集中的边后,改图是否为连通图。询问互相独立。
允许离线。
数据范围:$1 \leq n, k \leq 10^5$,$1 \leq m \leq 2 \times 10^5$,$1 \leq c \leq 4$。 数据范围:$1 \leq n, k \leq 10^5$,$1 \leq m \leq 2 \times 10^5$,$1 \leq c \leq 4$。时空限制:$2000 \ \mathrm{ms} / 256 \ \mathrm{MiB}$
## Solution
32 行未改动 static char buf[1 << 20], *fs, *ft; inline char gc() { if (fs == ft) { ft = (fs = buf) + fread(buf, 1, 1 << 20, stdin);
if (fs == ft) return EOF; }
return *fs++; } #define gc() getchar() inline int read() { int x = 0, f = 1; char s = gc();
while (s < '0' || s > '9') { if (s == '-') f = -f;
s = gc(); }
while (s >= '0' && s <= '9') { x = x * 10 + s - '0'; s = gc(); }
return x * f; }} using IO::read;
122 行未改动全部展开