自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(74)
  • 资源 (1)
  • 收藏
  • 关注

原创 1030. Travel Plan (30) PAT 甲级

传送门#include<stdio.h> #include<vector> #include<algorithm> #include<string.h>using namespace std;#define MAX_V 510 #define INF 100000000int n,m; int Start,End; int G[MAX_V][MAX_V]; int d[MAX_V]; int cos

2017-02-28 20:47:52 289

原创 1003. Emergency (25) PAT 甲级

传送门#include<stdio.h> #include<string.h> #include<vector>using namespace std;#define MAX_V 510 #define INF 1000000000 int G[MAX_V][MAX_V]; int weight[MAX_V]; bool visited[MAX_V]; int n,m; int num[MAX_V]

2017-02-28 19:22:28 354

原创 Dijkstra最短路

邻接矩阵表示#include<stdio.h> #include<map> #include<queue> #include<string.h> #include<math.h> #include<algorithm> #include<vector>using namespace std; #define MAX_V 510 #define INF 1000000000int n; int m;

2017-02-28 16:33:40 412

原创 1112. Stucked Keyboard (20) PAT甲级

传送门#include<stdio.h> #include<string.h> #define MAX_N 1100int k; char str[MAX_N];bool map[256]; bool visited[256];int main(){ scanf("%d",&k); scanf("%s",str); int count=1; int len=strle

2017-02-26 19:31:45 470

原创 1123. Is It a Complete AVL Tree (30) PAT 甲级

传送门#include<stdio.h> #include<algorithm> #include<queue>using namespace std;typedef struct Node{ int weight; int height; Node *lchild,*rchild; }AVLnode,*AVLtree;AVLtree root; int n; AVLnode

2017-02-24 21:25:43 402

原创 1066. Root of AVL Tree (25) PAT甲级

传送门 第一次手写AVL。。。。。#include<stdio.h> #include<algorithm>using namespace std;typedef struct Node{ int weight; int height; Node *lchild,*rchild; }AVLnode,*AVLtree;AVLtree root;AVLnode *newNode

2017-02-24 20:57:02 315

原创 1021. Deepest Root (25) PAT 甲级

传送门#include<stdio.h> #include<set> #include<vector>using namespace std;#define MAX_N 10100set<int> temp,ans; vector<int> G[MAX_N]; bool isRoot[MAX_N]; int father[MAX_N];int n;int find(int x){ int r

2017-02-24 16:15:10 283

原创 1034. Head of a Gang (30) PAT 甲级

传送门#include<stdio.h> #include<map> #include<string.h> #include<iostream>using namespace std;const int MAX_N=2100;int personNum=0;map<string,int> NametoId; map<int,string> IdtoName; map<string,int> Gang

2017-02-24 10:38:37 294

原创 1113. Integer Set Partition (25) PAT 甲级

传送门#include<stdio.h> #include<algorithm>using namespace std;#define MAX_N 100100int num[MAX_N]; int n;int main(){ scanf("%d",&n); int s1=0,s2=0; for(int i=0;i<n;i++){ scanf("%d",&nu

2017-02-23 12:05:32 282

原创 1110. Complete Binary Tree (25) PAT 甲级

传送门#include<stdio.h> #include<queue> #include<stdlib.h> #include<string.h>using namespace std;#define MAX_N 25 struct Node{ int lchild,rchild; Node(){ lchild=-1; rchild=-1;

2017-02-23 11:00:48 285

原创 1115. Counting Nodes in a BST (30) PAT 甲级

传送门#include<stdio.h> #include<queue>using namespace std;#define MAX_N 1100 typedef struct Node{ int data; Node *lchild,*rchild; int level; }bsnode,*BStree;int n;int level[MAX_N];void insert

2017-02-22 18:48:18 424

原创 1120. Friend Numbers (20) PAT 甲级

传送门#include<stdio.h> #include<set> using namespace std;set<int> s;int solve(int num){ int sum=0; while(num>0){ sum+=(num%10); num/=10; } return sum; }int main(){ int

2017-02-22 17:07:01 401

原创 1076. Forwards on Weibo (30) PAT 甲级

传送门#include<stdio.h> #include<vector> #include<queue> #include<string.h>#define MAX_V 1100using namespace std;struct Node{ int v; int level; }user;int n,l; vector<Node> G[MAX_V]; bool visited[M

2017-02-22 16:56:33 415

原创 PAT考试大纲

乙级(Basic Level)考生应具备以下基本能力: 1· 基本的C/C++的代码设计能力,以及相关开发环境的基本调试技巧; 2· 理解并掌握最基本的数据存储结构,即:数组、链表; 3· 理解并熟练编程实现与基本数据结构相关的基础算法,包括递归、排序、查找等; 4· 能够分析算法的时间复杂度、空间复杂度和算法稳定性; 5· 具备问题抽象和建模的初步能力,并能够用所学方法解决实际

2017-02-22 16:19:46 7035

原创 1044. Shopping in Mars (25) PAT 甲级

传送门#include<stdio.h> #include<vector>#define MAX_N 100100using namespace std;struct Node{ int s; int e; }node;vector<Node> v;int d[MAX_N]; int n,m; int Min=0;void solve(){ int res=Min;

2017-02-22 15:38:38 329

原创 1010. Radix (25) PAT 甲级

传送门#include<stdio.h> #include<algorithm> #include<string.h> #include<string> #include<math.h>using namespace std;typedef long long ll;#define MAX_N 15ll map[256]; ll INF=(1LL<<63)-1;char N1[MAX_N],N2[M

2017-02-22 11:00:40 363

原创 1007. Maximum Subsequence Sum (25) PAT 甲级

传送门#include<stdio.h> #define MAX_N 10100int num[MAX_N]; int dp[MAX_N]; int s[MAX_N];int main(){ int n; scanf("%d",&n); bool flag=false; for(int i=0;i<n;i++){ scanf("%d",&num[i])

2017-02-21 20:18:37 258

原创 1033. To Fill or Not to Fill (25) PAT 甲级

传送门#include<stdio.h> #include<string.h> #include<algorithm>using namespace std;#define MAX_N 600 struct station{ double price; double distance; }st[MAX_N];bool cmp(station a,station b){ ret

2017-02-21 19:47:05 293

原创 1095. Cars on Campus (30) PAT 甲级

传送门#include<stdio.h> #include<algorithm> #include<string> #include<string.h> #include<map> #define MAX_N 10100 using namespace std;struct Car{ char id[10]; int time; char status[4]; }car[MA

2017-02-21 17:21:24 310

原创 1080. Graduate Admission (30) PAT 甲级

传送门#include<stdio.h> #include<algorithm>using namespace std;#define MAX_STU 40100 #define MAX_SCH 110struct Student{ int GE; int GI; int sum; int ID; int choice[6]; int rank; }s

2017-02-21 16:18:53 389

原创 1103. Integer Factorization (30) PAT 甲级

传送门#include<stdio.h> #include<vector> #include<algorithm> #include<math.h> #include<stdlib.h> using namespace std;vector<int> v,fac,ans; int n,k,p;int maxfacnum=-1;void init(){ int i=0; int tem

2017-02-21 14:27:26 358

原创 1016. Phone Bills (25) PAT甲级

传送门#include<stdio.h> #include<algorithm> #include<string.h>using namespace std;#define MAX_N 1100 struct Record{ char name[25]; int month,d,h,m; bool status; }r[MAX_N],temp;int toll[25];int

2017-02-18 20:25:05 257

原创 1097. Deduplication on a Linked List (25) PAT甲级

传送门#include<stdio.h> #include<algorithm> #include<math.h> #include<stdlib.h>#define MAX_N 100100#define MAX_K 10100using namespace std; struct Node{ int address; int data; int next; int

2017-02-13 10:04:51 306

原创 1052. Linked List Sorting (25) PAT甲级

传送门#include<stdio.h> #include<algorithm>using namespace std;#define MAX_N 100005 //const int MAX_N=100005 struct Node{ int next; int data; int address; bool flag; }node[MAX_N];int n,hea

2017-02-13 09:42:29 301

原创 1055. The World's Richest (25) PAT甲级

传送门#include<stdio.h> #include<algorithm> #include<math.h> #include<string.h>using namespace std;#define MAX_N 100100 struct Person{ char name[10]; int age; int wealth; }p[MAX_N],valid[MAX_N

2017-02-12 19:24:14 320

原创 1012. The Best Rank (25) PAT甲级

传送门#include<stdio.h> #include<algorithm> #include<map> #include<utility> #define MAX_N 2100using namespace std; struct Student{ int id; int grade[4]; int rank[4]; }stu[MAX_N];map<int,int> p

2017-02-12 16:08:51 246

原创 1091. Acute Stroke (30) PAT甲级

传送门#include<stdio.h> #include<queue>#define MAX_X 1300 #define MAX_Y 130 #define MAX_Z 80using namespace std;int m,n,l,t;struct Node{ int x; int y; int z; }node;int matrix[MAX_X][MAX_Y][MAX

2017-02-12 11:03:25 336

原创 1075. PAT Judge (25) PAT甲级

传送门#include<stdio.h> #include<string.h> #include<algorithm>#define MAX_N 10100using namespace std;struct Student{ int id; int score[6]; bool flag; int score_sum; int prefectsolve;

2017-02-11 21:36:22 345

原创 1013. Battle Over Cities (25) PAT甲级

传送门#include<stdio.h> #include<vector> #include<string.h>#define MAX_N 1111 using namespace std;vector<int> G[MAX_N]; bool visited[MAX_N];int deletePoint; int n,m,k;void dfs(int v){ if(v==deletePoin

2017-02-11 18:45:37 262

原创 1049. Counting Ones (30) PAT甲级

传送门#include<stdio.h>int main(){ int n; int ans=0; int left;//当前位前面的位数 int right;//当前位后面的位数 int a=1; int pos;//当前位 scanf("%d",&n); while(n/a!=0){ left=n/(a*10);

2017-02-11 16:21:51 275

原创 1053. Path of Equal Weight (30)PAT甲级

传送门#include<stdio.h> #include<vector> #include<algorithm>#define MAX_N 110using namespace std;struct Node{ int weight; vector<int> child; }node[MAX_N];int n,m,Sum;int path[MAX_N];bool cmp(int a

2017-02-11 09:33:08 231

原创 1004. Counting Leaves (30) PAT甲级

传送门#include<stdio.h> #include<vector> #include<queue>using namespace std;#define MAX_N 110struct Node{ int level; vector<int> child; }node[MAX_N];int n,m;int gene[MAX_N]; int maxlevel=-1;void b

2017-02-11 00:33:29 257

原创 1106. Lowest Price in Supply Chain (25) PAT甲级

传送门#include<stdio.h> #include<queue> #include<math.h> #include<vector>using namespace std;#define MAX_N 100100struct Node{ int level; vector<int> child; }node[MAX_N];int n; double p,r; int num;

2017-02-11 00:09:31 341

原创 1090. Highest Price in Supply Chain (25) PAT甲级

传送门#include<stdio.h> #include<vector> #include<queue> #include<math.h> #define MAX_N 100100 using namespace std;struct Node{ int level; vector<int> child; }node[MAX_N];int n; double p,r; int de

2017-02-10 23:34:19 279

原创 1079. Total Sales of Supply Chain (25)PAT甲级

传送门#include<stdio.h> #include<math.h> #include<queue> #include<vector>#include<algorithm> #define MAX_N 100100using namespace std;int n; double p,r; double result=0.0; struct Node{ double data;

2017-02-10 23:03:33 396

原创 1094. The Largest Generation (25) PAT甲级

传送门#include<stdio.h> #include<vector> #include<queue>#define MAX_N 110using namespace std;struct Node{ int level; vector<int> child; }node[MAX_N];int gene[MAX_N];int n; int m; void bfs(int root

2017-02-10 21:47:41 345

原创 1064. Complete Binary Search Tree (30) PAT甲级

传送门#include<stdio.h> #include<algorithm>using namespace std;#define MAX_N 1100int n;int CBSTree[MAX_N]; int in[MAX_N];int co=1;void inOrder(int root){ if(root>n) return; inOrder(root*2);

2017-02-10 20:21:45 265

原创 1043. Is It a Binary Search Tree (25) PAT甲级

传送门#include<stdio.h> #include<vector>using namespace std;typedef struct Node{ int data; struct Node *lchild,*rchild; }BTnode,*BTree;int n; vector<int> ori,pre,preM,post,postM; void insert(BTre

2017-02-10 20:08:13 444

原创 1099. Build A Binary Search Tree (30)PAT甲级

传送门#include<stdio.h> #include<queue> #include<algorithm>#define MAX_N 110 using namespace std;struct Node{ int data; int lchild,rchild; }node[MAX_N];int n; int inorder[MAX_N]; int co=0;void inO

2017-02-10 19:13:36 258

原创 1107. Social Clusters (30) PAT甲级

传送门#include<stdio.h> #include<algorithm>using namespace std;#define MAX_N 1100 int set[MAX_N]; int n; int course[MAX_N]; int root[MAX_N];int find(int x){ int r=x; while(set[r]!=r){ r=se

2017-02-10 18:42:06 266

2009-2018 计算机考研408历年真题

考研历年真题,帮助考生考上理想的学校。

2018-12-09

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除