
pat
永远热血沸腾
这个作者很懒,什么都没留下…
展开
-
02-线性结构3. Pop Sequence
。。。原创 2015-03-25 22:51:12 · 568 阅读 · 0 评论 -
02-线性结构1. 一元多项式求导 链表
。。。原创 2015-03-28 09:17:58 · 1543 阅读 · 0 评论 -
04-树3. Root of AVL Tree
。。。原创 2015-04-08 22:37:56 · 772 阅读 · 0 评论 -
03-树2. Tree Traversals Again (25)
树的遍历原创 2015-05-08 21:56:22 · 768 阅读 · 0 评论 -
03-树1. List Leaves
。。。原创 2015-03-23 22:12:54 · 427 阅读 · 0 评论 -
PAT (Advanced Level) 1077. Kuchiguse (20)
#include<bits/stdc++.h>using namespace std;int main(){ int n,f,a[200],k; char s[200][1024],st[1024]; string ans; while(~scanf("%d",&n)) { ans=""; getchar();原创 2016-05-11 08:36:33 · 363 阅读 · 0 评论 -
2016年团体程序设计天梯赛-模拟赛
L1-1. N个数求和/* ***********************************************Author :MaltubEmail :xiang578@foxmail.comBlog :htttp://www.xiang578.com*****************************************原创 2016-05-15 19:46:49 · 758 阅读 · 0 评论 -
PAT-A-1051 Pop Sequence 【栈】
1051. Pop Sequence (25)Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possib原创 2016-04-05 21:30:16 · 1768 阅读 · 0 评论 -
2016年团体程序设计天梯赛-决赛 L2-014. 列车调度 【导弹拦截系统-最长上升子序列nlogn求法】
导弹拦截问题中的本质是求一个序列的最长上升子序列,只有这样才会新开导弹组。也就是本问题中的铁轨。#include<bits/stdc++.h>#include<bits/stdc++.h>using namespace std;int n,a[100000+10],b[100000+10];int cnt,t;int main(){ int n,m,k; scanf("%d原创 2016-07-21 20:32:25 · 828 阅读 · 0 评论 -
1123. Is It a Complete AVL Tree (30) 二叉搜索树
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <set>#include <map>#include <string>#include <math.h>#include <stdlib.h>#i原创 2017-03-03 15:51:38 · 290 阅读 · 0 评论 -
2017年团体程序设计天梯赛-总决赛 L1-6. 整除光棍
L1-6. 整除光棍当时想用java写,不过忘记Scanner怎么用了,现在用模拟重新写了一下#include<bits/stdc++.h>using namespace std;int x;int get(int c){ int k=0; for(int i=1;i<=c;i++) { k=k*10+1; k%=x; }原创 2017-04-16 10:21:16 · 1304 阅读 · 0 评论 -
2017年团体程序设计天梯赛-总决赛 L2-2. 重排链表
输入的数据可能不是一张链表的,陈越教授风格#include<bits/stdc++.h>using namespace std;struct node{ int add; int d; int next;} p[123456],p1[123456];int k,st,n,nt,m[123456],r[123456];int main(){ int a,d,t原创 2017-04-16 10:29:34 · 1369 阅读 · 0 评论 -
06-图1. List Components (25) 栈和队列
dfs,bfs,queue,stack原创 2015-05-04 14:38:40 · 479 阅读 · 0 评论 -
00-自测4. Have Fun with Numbers (20)
。。。原创 2015-05-07 18:00:43 · 1079 阅读 · 0 评论 -
00-自测3. 数组元素循环右移问题
#include#include#include#include#includeusing namespace std;int main(){ int a[150],n,m,i,j,temp; while(~scanf("%d%d",&n,&m)) { for(i=0;i<n;i++) scanf("%d",&a[i]); m原创 2015-03-16 20:27:56 · 460 阅读 · 0 评论 -
01-1. 最大子列和问题
。。。原创 2015-03-13 18:58:35 · 392 阅读 · 0 评论 -
00-自测1. 打印沙漏
。。。原创 2015-03-11 23:08:15 · 538 阅读 · 0 评论 -
00-自测2. 素数对猜想
。。。原创 2015-03-13 19:43:59 · 438 阅读 · 0 评论 -
01-2. Maximum Subsequence Sum
。。。原创 2015-03-14 19:28:38 · 375 阅读 · 0 评论 -
07-图5. 旅游规划(25)
d原创 2015-05-09 16:47:02 · 1246 阅读 · 0 评论 -
00-自测5. Shuffling Machine (20)
模拟原创 2015-05-09 13:36:05 · 717 阅读 · 0 评论 -
pat 09-排序1. 排序(25)
排序测试原创 2015-05-04 13:57:20 · 427 阅读 · 0 评论 -
pat 06-图2. Saving James Bond - Easy Version (25)
dfs原创 2015-05-03 20:09:16 · 478 阅读 · 0 评论 -
06-图3. 六度空间 (30)
bfs+邻接表原创 2015-05-05 13:05:46 · 749 阅读 · 0 评论 -
07-图4. Saving James Bond - Hard Version (30)
dfs原创 2015-05-06 22:39:55 · 1963 阅读 · 0 评论 -
2017年团体程序设计天梯赛-总决赛 L3-1. 二叉搜索树的结构
注意一下查询的值不一定都在二叉树上面#include<bits/stdc++.h>using namespace std;int n,t,cnt,f[1024],a,b,fa,fb;char s[1024];map<int,int>mp;struct node{ int n; int d; int l,r;} p[1024];void build(int now原创 2017-04-16 11:15:53 · 607 阅读 · 0 评论