
未完成
文章平均质量分 64
小雪乃
这个作者很懒,什么都没留下…
展开
-
PAT 甲级 1098. Insertion or Heap Sort (25)
According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. At each iteration, insertion sort removes one element from the input原创 2017-10-06 22:30:15 · 224 阅读 · 0 评论 -
草稿 感冒蚂蚁
include include include include using namespace std;int cnt=1; vector v; int n; void dfs(int x){ if(v[x]>0){ for(int i=0;i原创 2017-12-20 17:09:40 · 197 阅读 · 0 评论 -
蓝桥杯 历届试题 数字游戏 部分超时
问题描述 栋栋正在和同学们玩一个数字游戏。 游戏的规则是这样的:栋栋和同学们一共n个人围坐在一圈。栋栋首先说出数字1。接下来,坐在栋栋左手边的同学要说下一个数字2。再下面的一个同学要从上一个同学说的数字往下数两个数说出来,也就是说4。下一个同学要往下数三个数,说7。依次类推。 为了使数字不至于太大,栋栋和同学们约定,当在心中数到 k-1 时,下一个数字从0开始数。例如,当k=13时,栋栋和原创 2017-12-20 16:08:49 · 292 阅读 · 0 评论 -
PAT 甲级 1131. Subway Map (30)
In the big cities, the subway systems always look so complex to the visitors. To give you some sense, the following figure shows the map of Beijing subway. Now you are supposed to help people with you原创 2017-10-26 04:36:10 · 231 阅读 · 0 评论 -
PAT 甲级 1129. Recommendation System
Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that rates the user’s preference by the number of time...原创 2017-10-26 02:26:07 · 463 阅读 · 0 评论 -
PAT 甲级 1127. ZigZagging on a Tree (30)
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences. And it is a simple standa原创 2017-10-23 05:35:36 · 297 阅读 · 0 评论 -
PAT 甲级 1089. Insert or Merge (25)
According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input dat原创 2017-10-06 00:12:26 · 201 阅读 · 0 评论 -
PAT 甲级 1123. Is It a Complete AVL Tree (30)
An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is转载 2017-10-20 06:57:38 · 277 阅读 · 0 评论 -
PAT 甲级 1119. Pre- and Post-order Traversals (30)
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences, or preorder and inorder t原创 2017-10-20 02:21:21 · 272 阅读 · 0 评论 -
PAT 甲级 1072. Gas Station (30)
A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must guarantee that all the hou原创 2017-10-02 18:48:08 · 215 阅读 · 0 评论 -
PAT 甲级 1073. Scientific Notation (20)
Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9]"."[0-9]+E[+-][0-9]+ which means that the in原创 2017-10-02 19:57:14 · 188 阅读 · 0 评论 -
PAT 甲级 1066. Root of AVL Tree (25)
An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is原创 2017-10-02 09:43:19 · 186 阅读 · 0 评论 -
PAT 甲级 1105. Spiral Matrix (25)
This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix is filled in from the first element at the upper-left corner, then move in原创 2017-10-09 20:22:55 · 295 阅读 · 0 评论 -
PAT甲级 1111. Online Map (30)
Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is the shortest, and the other is the fastest. It is gu原创 2017-10-18 02:55:00 · 211 阅读 · 0 评论 -
PAT 甲级 1018. Public Bike Management (30)
There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and return it to any other stations in the原创 2017-09-20 21:37:41 · 202 阅读 · 0 评论 -
蓝桥杯 算法提高 金陵十三钗
金陵十三钗 本题难度:难 本题占分比例:5% 问题描述 在电影《金陵十三钗》中有十二个秦淮河的女人要自我牺牲代替十二个女学生去赴日本人的死亡宴会。为了不让日本人发现,自然需要一番乔装打扮。但由于天生材质的原因,每个人和每个人之间的相似度是不同的。由于我们这是编程题,因此情况就变成了金陵n钗。给出n个女人和n个学生的相似度矩阵,求她们之间的匹配所能获得的最大相似度。 所谓相似原创 2017-12-18 21:42:21 · 503 阅读 · 0 评论