浙大pat
文章平均质量分 80
BoomHusky
计算机专业硕士,希望自己的实力能够更强
展开
-
浙大pat | 浙大pat乙级 1005~1008
1005德才论 (25)2356969224%宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。”现给出一批考生的德才分数,请根据司马光的理论给出录取排名。原创 2018-02-01 20:08:30 · 492 阅读 · 0 评论 -
浙大pat | 牛客网甲级 1013 Hashing (25) 哈希表
题目描述The task of this problem is simple: insert a sequence ofdistinct positive integers into a hash table, and output the positions of theinput numbers. The hash function isdefined to be "H(key) = key...原创 2018-04-03 10:47:32 · 313 阅读 · 0 评论 -
浙大pat | DFS 牛客网甲级 1014Total Sales of Supply Chain (25)
题目描述A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a productfrom supplier to customer.Starting from one root supplier, everyone on t...原创 2018-04-03 10:48:40 · 212 阅读 · 0 评论 -
浙大pat | 牛客网甲级 1016 Mice and Rice (25) 理解难题
题目描述Mice and Rice is the name of a programming contest in which each programmermust write a piece of code to control the movements of a mouse in a givenmap. The goal of each mouse is to eat asmuch ri...原创 2018-04-03 10:49:56 · 217 阅读 · 0 评论 -
浙大pat | 牛客网甲级 1017 Stack (30) 实现中位数栈
题目描述Stack is one of the most fundamental data structures, which isbased on the principle of Last In First Out (LIFO). The basic operations include Push (insertingan element onto the top position) and...原创 2018-04-03 10:50:58 · 510 阅读 · 0 评论 -
浙大pat | 牛客网甲级1063 Count PAT's (25)字符串
题目描述The string APPAPT contains two PAT's as substrings. The firstone is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.Now...原创 2018-03-28 13:32:49 · 161 阅读 · 0 评论 -
浙大pat | 牛客网甲级 1062 To Buy or Not to Buy (20)
题目描述Eva would like to make a string of beads with her favoritecolors so shewent to a small shop to buy some beads. There were many colorfulstrings of beads. However the owner of theshop would only se...原创 2018-03-28 13:34:08 · 191 阅读 · 0 评论 -
浙大pat | 1058 Broken Keyboard (20)字符串
题目描述On a broken keyboard, some of the keys are worn out. So when youtype some sentences, the characters corresponding to those keys will not appear on screen.Now given a string that you are supposed t...原创 2018-03-28 13:35:13 · 145 阅读 · 0 评论 -
浙大pat | 牛客网 1034 Favorite Color Stripe (30) 最长递增子序列 DP
题目描述Eva is trying to make her own color stripe out of a givenone. She would like to keep only herfavorite colors in her favorite order by cutting off those unwanted pieces andsewing the remaining par...原创 2018-03-28 13:36:27 · 201 阅读 · 0 评论 -
浙大pat | 牛客网甲级 1025 Sort with Swap(0) (25)排序
题目描述Given any permutation of the numbers {0, 1, 2,..., N-1}, it iseasy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed touse? For example, to sort {4, 0...原创 2018-03-28 13:37:16 · 413 阅读 · 0 评论 -
浙大pat | 牛客网甲级 1037Find Coins (25) 数组循环遍历
题目描述Eva loves to collect coins from all over the universe, includingsome other planets like Mars. One dayshe visited a universal shopping mall which could accept all kinds of coins aspayments. Howev...原创 2018-03-28 13:38:10 · 309 阅读 · 0 评论 -
浙大pat | 牛客网甲级 1038 Counting Ones (30)数论题
题目描述The task is simple: given any positive integer N, you aresupposed to count the total number of 1's in the decimal form of the integersfrom 1 to N. For example, given N being12, there are five 1's...原创 2018-03-28 13:39:08 · 238 阅读 · 0 评论 -
浙大pat | 1042 Path of Equal Weight (30) DFS
题目描述Given a non-empty tree with root R, and with weight Wi assigned to each treenode Ti. The weight of a path from R to L is defined to be the sumof the weights of all the nodes along the pathfrom R ...原创 2018-03-28 13:40:01 · 166 阅读 · 0 评论 -
浙大pat | 牛客网甲级 1045 Hello World for U (20) 字符串
Given any string of N (>=5) characters, you are asked to formthecharacters into the shape of U. For example, "helloworld" canbe printed as: h de ll rlowo That is, the charactersmust be printed ...原创 2018-03-28 13:40:47 · 195 阅读 · 0 评论 -
浙大pat | 甲级 牛客网1012Kuchiguse (20) 字符串最长公共后缀
题目描述The Japanese language is notorious for its sentence endingparticles. Personal preference of such particles can be considered as areflection of the speaker's personality. Such a preference is calle...原创 2018-04-03 10:45:15 · 313 阅读 · 0 评论 -
浙大pat | 浙大pat 牛客网甲级1048 Head of a Gang (30)最大强联通分量
题目描述One way that the police finds the head of a gang is to checkpeople'sphone calls. If there isa phone call between A and B, we say that Aand B is related. Theweight of a relation is defined to be ...原创 2018-03-23 12:53:33 · 250 阅读 · 0 评论 -
浙大pat | 浙大pat 牛客网甲级1061 Insert or Merge (25)判断是插入排序还是归并排序
According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, andgrowing a sorted output list. Each iteration, insertion sort removes one element from the input data, fi...原创 2018-03-23 12:51:45 · 546 阅读 · 0 评论 -
浙大pat | 浙大pat乙级 1001~1004
1001A+B和C (15)题目描述给定区间[-2的31次方, 2的31次方]内的3个整数A、B和C,请判断A+B是否大于C。输入描述:输入第1行给出正整数T(,是测试用例的个数。随后给出T组测试用例,每组占一行,顺序给出A、B和C。整数间以空格分隔。输出描述:对每组测试用例,在一行中输出“Case原创 2018-01-31 19:36:50 · 434 阅读 · 0 评论 -
浙大pat | 浙大pat 牛客网PAT顶级(Top Level)练习题 1001
1001 LUCKY STRING 1872 8254 22% 题目描述A string s is LUCKY if and only if the number of differentcharacters in s is a fibonacci number. Given a string consisting of only lowercase letters , output a...原创 2018-02-12 18:51:28 · 7481 阅读 · 0 评论 -
浙大pat | 浙大pat 牛客网PAT顶级(Top Level)练习题 1002
1002 Numeric Keypad 796 5608 14% The numberic keypad on your mobile phone looks like below: 123 456 789 0 suppose you areholding your mobile phone with single hand. Your thumbpoints at digit 1....原创 2018-02-12 18:52:05 · 1030 阅读 · 0 评论 -
浙大pat | 浙大pat 牛客网PAT顶级(Top Level)练习题 1003 博弈论
You class are planning for a spring outing. N people are votingfor adestination out of K candidate places. The voting progress isbelow: First the class vote forthe first candidate place. If more than ...原创 2018-02-12 18:52:54 · 1733 阅读 · 0 评论 -
浙大pat | 浙大pat牛客网乙级1009
1009 1019. 数字黑洞 (20) 2565 10433 24% 题目描述给定任一个各位数字不完全相同的4位正整数,如果我们先把4个数字按非递增排序,再按非递减排序,然后用第1个数字减第2个数字,将得到 一个新的数字。一直重复这样做,我们很快会停在有“数字黑洞”之称的6174,这个神奇的数字也叫Kaprekar常数。 例如,我们从6767开始,将得到 7766 - 6677 =...原创 2018-03-07 18:47:51 · 666 阅读 · 1 评论 -
浙大pat | 浙大pat 牛客网甲级 1001Public Bike Management (30) 迪杰斯特拉改进算法
题目描述There is a public bike service in Hangzhou City which providesgreat convenience to the tourists from all over the world. One may rent a bike at any station and returnit to any other stations in t...原创 2018-03-07 18:49:04 · 264 阅读 · 0 评论 -
浙大Pat | 浙大pat 牛客网甲级 1003 Highest Price in Supply Chain (25)DFS
题目描述A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a productfrom supplier to customer.Starting from one root supplier, everyone on t...原创 2018-03-22 14:48:02 · 205 阅读 · 0 评论 -
浙大pat | 浙大pat 牛客网甲级 1007 Consecutive Factors (20) 数论
题目描述Among all the factors of a positive integer N, there may existseveral consecutive numbers. Forexample, 630 can be factored as 3*5*6*7, where 5, 6, and 7 are the threeconsecutive numbers. Now giv...原创 2018-03-22 14:49:07 · 330 阅读 · 0 评论 -
浙大pat | 浙大pat 牛客网甲级 1002 All Roads Lead to Rome (30)迪杰斯特拉算法改进
链接:https://www.nowcoder.com/questionTerminal/bf8045decb1348a3bd6967305cbdad4c来源:牛客网Indeed there are many different tourist routes from our city to Rome. You aresupposed to find your clients the route ...原创 2018-03-19 13:08:13 · 433 阅读 · 0 评论 -
浙大pat | 浙大pat 牛客网甲级 1006 Cars on Campus (30)多区域覆盖题
题目描述Zhejiang University has 6 campuses and a lot of gates. From each gate we can collect the in/outtimes and the plate numbers of the cars crossing the gate. Now with all the information available, ...原创 2018-03-23 12:47:17 · 617 阅读 · 0 评论 -
浙大Pat | 浙大pat 牛客网甲级 1004 Acute Stroke (30) BFS
题目描述One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in whichthe core regions are identified in each MRI slice, your job is ...原创 2018-03-23 12:48:14 · 188 阅读 · 0 评论 -
浙大pat | 浙大pat 牛客网甲级 1098. Insertion or Heap Sort (25)判断是哪种排序方式
题目描述According to Wikipedia:Insertion sort iterates, consuming one inputelement each repetition, and growing a sorted output list. Each iteration,insertion sort removes one element from the input data,...原创 2018-03-23 12:49:27 · 178 阅读 · 0 评论 -
浙大pat | 浙大pat 牛客网甲级 1010 Build A Binary Search Tree (30) 二叉搜索树
题目描述A Binary Search Tree (BST) is recursively defined as a binarytree which has the following properties:The left subtree of a node contains only nodes with keys less than the node'skey.The right subt...原创 2018-03-23 12:50:41 · 234 阅读 · 0 评论 -
浙大pat 牛客网 1011 Forwards on Weibo (30) BFS
题目描述Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers,and may follow many other users as well. Hence a social network is formed with followers relations. Wh...原创 2018-03-28 13:42:07 · 128 阅读 · 0 评论