10 2020 档案
摘要:hdu4578 Transformation 传送门 ###题意 有一个长度为$n(1\leq n\leq 100000)$,初始值全为$0$的序列$a$。给出$m(1\leq m\leq 100000)$种操作或者询问: $1:\(将区间\)[x,y]$中的值全部加上$c$ $2:\(将区间\)[
阅读全文
摘要:hdu1828 Picture 传送门 ###题意 平面上有$n(0\leq n < 5000)\(个矩形,每个矩形左下角坐标为\)(x_1,y_1)\(,右上角坐标为\)(x_2,y_2)\(,坐标的值是位于\)[-10000,10000]$之中内的整数,计算矩形周长并。 ###题解 ####方法
阅读全文
摘要:并查集 const int maxn=100010; int f[maxn]; void init(){ for(int i=1;i<=n;i++) f[i]=i; } int find(int x){ if(x==f[x]) return x; return f[x]=find(f[x]); }
阅读全文

浙公网安备 33010602011771号