PTA
ThreeWater-
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
家谱树
静态模拟家谱树#include <stdio.h> #include <string.h> struct node { char name[15]; int bcnt,scnt,son[105]; }a[105]; int ans; void _find(int x,int y) { if(ans)return; for(int i=0;i<a[y].scnt;i++原创 2016-11-23 11:10:24 · 2073 阅读 · 0 评论 -
pta basin 1002
#include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <queue> #include <map> #include <cmath> #include <iostream> #include <set> #include <vector> #define INF 0x3f3f3f3f原创 2017-03-12 18:11:52 · 423 阅读 · 0 评论 -
pta basin 1001
#include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <queue> #include <map> #include <cmath> #include <iostream> #include <set> #include <vector> #define INF 0x3f3f3f3f原创 2017-03-12 18:05:16 · 263 阅读 · 0 评论 -
多维最短路。
注意点: 看代码注释#include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <queue> #include <map> #include <cmath> #include <iostream> #include <set> #include <vector> #define INF原创 2017-03-12 18:00:54 · 387 阅读 · 0 评论 -
堆判断
#include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <queue> #include <map> #include <cmath> #include <iostream> #include <set> #include <vector> #define INF 0x3f3f3f3f原创 2017-03-11 10:32:56 · 396 阅读 · 0 评论 -
城市间紧急救援-多维最短路
#include <cstdio> #include <cstring> #include <algorithm> #include <queue> #define INF 0x3f3f3f3f using namespace std; const int N=505; int n,m,s,d; int ren[N]; int ma[N][N]; int cnt[N]; int vis[N]; in原创 2016-12-08 19:58:50 · 513 阅读 · 0 评论 -
公路村村通 -并查集
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; struct node { int u,v,len; }a[3005]; int cmp(node x,node y) { return x.len<y.len; } int f[1005]; int find(int x) {原创 2016-12-08 19:57:23 · 467 阅读 · 0 评论 -
笛卡尔树
双关键字,关于K1的二叉搜索树,关于K2的最小堆。 判断中序遍历是否为递增,即可判断是否为二叉搜索树。 最小堆 看路径是否递增即可。#include<stdio.h> #include<string.h> #include<stdlib.h> struct node { int l,r,k1,k2; }a[1005]; int num[1005],cnt=0,flag; int vis[原创 2016-11-23 11:20:17 · 515 阅读 · 0 评论 -
目录树
xjb水过。。。#include <stdio.h> #include <string.h> #include <stdlib.h> char s[10005][280]; struct node { int cnt; char str[280]; }ss[10005]; int cmp(const void *a ,const void *b) { return strcm原创 2016-11-23 11:15:46 · 382 阅读 · 0 评论 -
PTA--双向链表模拟Deque
//最重要的是细心#include <stdio.h> #include <stdlib.h> #include <cstring> #define ElementType int #define ERROR 1e5 typedef enum { push, pop, inject, eject, end } Operation; typedef struct Node *PtrToNode; st原创 2016-11-23 11:06:04 · 712 阅读 · 0 评论 -
最小堆模拟优先队列
给你n个命令,然后有2种命令,添加消息,每个消息都带有一个数字表示优先级,数字越小,越早输出, 一种是读取信息,输出现在优先级最高的。 由于只能用C,那么手写了一个最小堆模拟优先队列。#include <stdio.h> #include <string.h> struct node { int pp; char ss[11]; }cur,q[100005]; int main(原创 2016-11-23 11:09:34 · 424 阅读 · 0 评论 -
PAT(basin)
1001:原创 2017-03-12 18:04:55 · 391 阅读 · 0 评论
分享