代码改变世界

阅读排行榜

并查集和带权并查集

2017-04-26 00:07 by roffen, 2430 阅读, 收藏,
摘要: 这两天做了几道并查集的题目,hdu的联通工程啊more is better 啊,然后卡在hdu1829,带权的并查集,没搞懂,尝试写下来让思路清晰些。 并查集是一种维护不同集合,在此基础上实现快速判断,统计个数等等的算法。 基础的有find和join两个功能,其中join作用于接收新数据。 并查集应 阅读全文

c艹学习之路(2)---函数,递归,穷举

2016-11-09 19:55 by roffen, 297 阅读, 收藏,
摘要: 11.9 /*#include<iostream>#include<cmath>#include<iomanip>using namespace std;int judge(double side1, double side2);int main(){ cout << "side1\t" << "s 阅读全文

算法学习之路(1)

2016-12-02 15:01 by roffen, 203 阅读, 收藏,
摘要: #include<iostream>#include<iomanip>#include "string.h"#include<cstdio>#include<cmath>#include<time.h>using namespace std;/*int main(){ int a, b; while 阅读全文

c艹学习之路(1)循环

2016-09-25 20:03 by roffen, 183 阅读, 收藏,
摘要: #include<iostream>using namespace std;int main()/*{ int i=1,j=0;//while循环 while(i<=10) { j+=i; i++; } cout<<j<<endl; int i=1,j=0;//do...while循环 do { j 阅读全文

算法学习之路(2)

2016-12-13 21:29 by roffen, 177 阅读, 收藏,
摘要: 这段时间学到了快速幂,贪心,不过仅仅是知晓而已 学到了链表结构,和在algorithm库里的sort函数,functional里的great<type>()的使用 #include<iostream>#include<algorithm>#include<functional>#include<cm 阅读全文