会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
coodyz の blog
莫道君行早,更有早行人。
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
下一页
2019年3月31日
pta-L2-032 彩虹瓶 (25 分)
摘要: L2-032 彩虹瓶 (25 分) L2-032 彩虹瓶 (25 分) L2-032 彩虹瓶 (25 分) 彩虹瓶的制作过程(并不)是这样的:先把一大批空瓶铺放在装填场地上,然后按照一定的顺序将每种颜色的小球均匀撒到这批瓶子里。 假设彩虹瓶里要按顺序装 N 种颜色的小球(不妨将顺序就编号为 1 到
阅读全文
posted @ 2019-03-31 10:35 Coodyzのblog
阅读(2106)
评论(0)
推荐(3)
2019年3月27日
pat-L2-019 悄悄关注
摘要: L2-019 悄悄关注 (25 分) L2-019 悄悄关注 (25 分) L2-019 悄悄关注 (25 分) 新浪微博上有个“悄悄关注”,一个用户悄悄关注的人,不出现在这个用户的关注列表上,但系统会推送其悄悄关注的人发表的微博给该用户。现在我们来做一回网络侦探,根据某人的关注列表和其对其他用户的
阅读全文
posted @ 2019-03-27 16:28 Coodyzのblog
阅读(217)
评论(0)
推荐(0)
2019年3月25日
dfs模板
摘要: 1 int search(int t) 2 { 3 if(满足输出条件) 4 { 5 输出解; 6 } 7 else 8 { 9 for(int i=1;i<=尝试方法数;i++) 10 if(满足进一步搜索条件) 11 { 12 ...
阅读全文
posted @ 2019-03-25 21:49 Coodyzのblog
阅读(139)
评论(0)
推荐(0)
二叉树
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define OVERFLOW 3 9 using namespace std; 10 typedef char TElemType; 11 TElemType ch; 12 typedef st...
阅读全文
posted @ 2019-03-25 21:46 Coodyzのblog
阅读(179)
评论(0)
推荐(0)
拓扑排序
摘要: 拓扑排序算法主要是循环执行以下两步,直到不存在入度为0的顶点为止。 (1) 选择一个入度为0的顶点并输出之; (2) 从网中删除此顶点及所有出边。 循环结束后,若输出的顶点数小于网中的顶点数,则输出“有回路”信息,否则输出的顶点序列就是一种拓扑序列。 输入 第一行输入两个整数n和m,n表示途中节点数,m表示途中边数;接下来输入m行,每一行有两个整数v1和v2,v1和v...
阅读全文
posted @ 2019-03-25 21:43 Coodyzのblog
阅读(185)
评论(0)
推荐(0)
最大公因数(辗转相除法)
摘要: int gys(int m, int n){ return n == 0 ? m : gys(n, m % n); }
阅读全文
posted @ 2019-03-25 21:42 Coodyzのblog
阅读(632)
评论(0)
推荐(0)
字典序
摘要: #include #include using namespace std; void Prim(int list[],int n) { int num=1,a=0,b=0; for(int i=n;i>0;i--) num*=i; while(num--) { for(int i=0;i0;--i){ if...
阅读全文
posted @ 2019-03-25 21:41 Coodyzのblog
阅读(139)
评论(0)
推荐(0)
并查集
摘要: int find(int x){ if(x==pre[x]) return x; return pre[x]=find(pre[x]); } void unite(int x,int y){ x=find(x); y=find(y); if(x!=y) pre[x]=y; } void is_connect(){//if cnt == 1 :连通集 ...
阅读全文
posted @ 2019-03-25 21:39 Coodyzのblog
阅读(137)
评论(0)
推荐(0)
优先队列
摘要: 1 priority_queue, cmp > q2; 2 struct cmp{ 3 bool operator () (const int &a, const int &b){ 4 return a>b; 5 } 6 }; 7 8 9 10 #include 11 using namespace std; 12 13 struct...
阅读全文
posted @ 2019-03-25 21:39 Coodyzのblog
阅读(112)
评论(0)
推荐(0)
c++控制格式
摘要: #include <iomanip> cout<<setw(9)<<left<<a<<"#"<<endl;//占位9个字符 ~~~ 左对齐 cout<<setiosflags(ios::fixed)<<setprecision(2)<<a; // ~~~ 保留两位小数
阅读全文
posted @ 2019-03-25 21:38 Coodyzのblog
阅读(101)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
下一页
公告