码迷,mamicode.com
首页 >  
搜索关键字:PAT 动态地址转换    ( 13520个结果
PAT:1030. Travel Plan (30) AC
#include#include#includeusing namespace std;const int MAXV=510;const int INF=0x3fffffff;int N,M,S,D; //城市数,高速公路数,起点,终点bool visit[MAXV]; //标记...
分类:其他好文   时间:2015-03-09 20:38:33    阅读次数:170
pat1020. Tree Traversals (25)
算法思路: 1、后序最后元素为根,根将中序分为左右子树 2、层序遍历利用队列实现,java使用LinkedList import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; class Node{ int key; Node left; Node right; public Node...
分类:其他好文   时间:2015-03-09 11:04:05    阅读次数:120
PAT 1074. Reversing Linked List
1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 class Node { 9 public: 10 int data; 11 int next; 12 ...
分类:其他好文   时间:2015-03-09 01:40:09    阅读次数:145
PAT:1064. Complete Binary Search Tree (30) AC
#include#includeusing namespace std;const int MAX=1010;int n;int arr[MAX]; //存放原始数组int arrI=0;int CBT[MAX]; //二叉排序树层序遍历序列【思维】中序遍历在数组中存放的就是层序...
分类:其他好文   时间:2015-03-08 18:40:53    阅读次数:132
1090. Highest Price in Supply Chain
A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer. Starting from one root supplier, everyone on ...
分类:其他好文   时间:2015-03-08 17:15:36    阅读次数:130
PAT:1053. Path of Equal Weight (30) AC
#include#include#include#includeusing namespace std;const int MAX=1010;int n,m; //n个节点,m个非叶子节点 long long int S; //待测权值long long int weight[M...
分类:其他好文   时间:2015-03-08 16:56:00    阅读次数:177
PAT:1079. Total Sales of Supply Chain (25) AC
#include#include#includeusing namespace std;const int MAX=100010;int DEPest=0;int root=-1,N;double P,r,sum=0;vector child[MAX]; //child[父亲][孩子]...
分类:其他好文   时间:2015-03-08 15:26:07    阅读次数:138
PAT:1090. Highest Price in Supply Chain (25) AC
#include#includeusing namespace std;const int MAX=100010;int DEPest=0,times=0;vector child[MAX]; //child[父亲][孩子] 二维数组表示树形结构void DFS(int root,i...
分类:其他好文   时间:2015-03-08 14:08:55    阅读次数:178
PAT:1003. 我要通过!(20) AC
#include#includeint main(){ int n; scanf("%d",&n); while(n--) { char str[110]; scanf("%s",str); int len=strlen(str); int numP=0,numT=0...
分类:其他好文   时间:2015-03-08 11:41:52    阅读次数:142
PAT:1027. 打印沙漏(20) AC
#includeint main(){ int n; char xing; scanf("%d %c",&n,&xing); int num=1,i=1; while(1) { num = num + 2 * (i + 2); //一开始就超出,不改变i if...
分类:其他好文   时间:2015-03-07 19:57:45    阅读次数:111
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!