10 2020 档案

摘要:hdu4578 Transformation 传送门 ###题意 有一个长度为$n(1\leq n\leq 100000)$,初始值全为$0$的序列$a$。给出$m(1\leq m\leq 100000)$种操作或者询问: $1:\(将区间\)[x,y]$中的值全部加上$c$ $2:\(将区间\)[ 阅读全文
posted @ 2020-10-09 22:57 fxq1304 阅读(69) 评论(0) 推荐(0)
摘要:hdu1828 Picture 传送门 ###题意 平面上有$n(0\leq n < 5000)\(个矩形,每个矩形左下角坐标为\)(x_1,y_1)\(,右上角坐标为\)(x_2,y_2)\(,坐标的值是位于\)[-10000,10000]$之中内的整数,计算矩形周长并。 ###题解 ####方法 阅读全文
posted @ 2020-10-08 22:29 fxq1304 阅读(18) 评论(0) 推荐(0)
摘要:并查集 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]); } 阅读全文
posted @ 2020-10-02 22:44 fxq1304 阅读(11) 评论(0) 推荐(0)