- 博客(291)
- 收藏
- 关注
原创 8.29 PAT 甲级 1054 The Dominant Color
Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called the dominant color. Astrictlydominant color takes more than..
2020-08-29 20:31:16
89
原创 8.29 PAT 甲级 1047 Student List for Course
Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input Specification:Each input file contains one test case. F
2020-08-29 14:22:15
120
原创 8.29 PAT 甲级 1041 Be Unique
Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1,104]. The first one who bets on a unique number wins. For example, if there are 7 peop
2020-08-29 07:49:00
110
原创 8.28 PAT 甲级 1031 Hello World for U
Given any string ofN(≥5) characters, you are asked to form the characters into the shape ofU. For example,helloworldcan be printed as:h de ll rlowoThat is, the characters must be printed in the original order, starting top-down from the le...
2020-08-28 22:16:16
120
原创 8.28 PAT 甲级 1008 Elevator
The highest building in our city has only one elevator. A request list is made up withNpositive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to..
2020-08-28 21:00:47
107
原创 8.27 PAT 甲级 1062 Talent and Virtue
About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outstanding in both talent and virtue must be a "sage(圣人)"; being less excellent but with o
2020-08-27 16:52:38
145
原创 8.25 PAT 甲级 1048 Shuffling Machine
Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where employees collaborate with gamblers by performing inadequate shuffles, many casinos employ
2020-08-25 10:03:24
85
原创 8.24 PAT 甲级 1092 To Buy or Not to Buy
Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of beads. However the owner of the shop would only sell the strings in whole pieces. Hence Eva must check whet
2020-08-24 09:06:01
153
原创 8.24 PAT 甲级 1011 World Cup Betting
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football betting fans were putting their money
2020-08-24 08:35:29
112
原创 8.22 PAT 甲级 1056 Mice and Rice
Mice and Riceis the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much rice as possible in order to become a FatMouse.First the p.
2020-08-22 17:20:46
98
原创 8.21 PAT 甲级 1037 Magic Coupon
The magic shop in Mars is offering some magic coupons. Each coupon has an integerNprinted on it, meaning that when you use this coupon with a product, you may getNtimes the value of that product back! What is more, the shop also offers some bonus produ...
2020-08-21 08:44:37
108
原创 8.20 总结实现图像检索到运行到小程序上遇到的问题
乱序。随缘(其实是随我7s的记忆)记录。① 'list' object has no attribute 'size'列表对象没有属性'尺寸'(我这翻译的哈哈哈哈哈哈自己都笑死 好中国风)。。大概困了我有一两天。因为原来在anconda上运行的时候是很顺畅的,到虚拟环境下就。。这样了。试过很多方法:把数据类型改成元组/卸载sklearn库,再重装/换了个中国环境/把可以运行上的anconda上的sklearn库移花接木到虚拟环境下......每次都觉得快成功了,事实证明,全部都是幻想。然
2020-08-20 22:08:51
198
原创 8.20 PAT 甲级 1148 Werewolf - Simple Version
Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game,player #1 said: "Player #2 is a werewolf."; player #2 said: "Player #3 is a human."; player #3 said: "Player #4 i
2020-08-20 10:09:43
131
原创 8.19 PAT 甲级 1015 The World‘s Richest
Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, but concentrate only on the people in a certain range of ages. That is, given the net wor
2020-08-19 15:05:43
113
原创 8.18 PAT 甲级 1114 Family Property
This time, you are supposed to help us collect the data for family-owned property. Given each person's family members, and the estate(房产)info under his/her own name, we need to know the size of each family, and the average area and number of sets of their
2020-08-18 10:39:28
130
原创 7.21 PAT 甲级 Find Coins
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special requirement of the payment: for eac
2020-07-21 17:55:22
127
原创 6.23 PAT 甲级 1013 Battle Over Cities
It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other highways to keep the rest of the c
2020-06-23 11:14:06
195
转载 【转】6.22
监督学习(Supervised Learning) 在监督学习中,给定一组数据,我们知道正确的输出结果应该是什么样子,并且知道在输入和输出之间有着一个特定的关系。这么说可能理解起来不是很清晰,没关系,后面有具体的例子。 监督学习的分类 监督学习可分为“回归”和“分类”问题。监督学习分类在回归问题中,我们会预测一个连续值。也就是说我们试图将输入变量和输出用一个连续函数对应起来;而在分类问题中,我们会预测一个离散值,我们试图将输入变量与离散的类别对应起来。下面举两个例子,就会非..
2020-06-22 17:04:51
141
原创 6.2 PAT 甲级 1068 Find More Coins
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special requirement of the payment: for eac
2020-06-02 19:01:11
176
原创 5.22 PAT 甲级 1045 Favorite Color Stripe
Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwanted pieces and sewing the remaining parts together to form her favorite color stripe.It is said
2020-05-22 17:32:27
166
原创 5.22 PAT 甲级 1007 Maximum Subsequence Sum
Given a sequence ofKintegers {N1,N2, ...,NK}. A continuous subsequence is defined to be {Ni,Ni+1, ...,Nj} where1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest sum of its elements. For exampl...
2020-05-22 08:59:33
135
原创 [error]:无法打开要写入的文件 XXX。您可能没有写入权限。
错误使用 imwrite (line 454)无法打开要写入的文件 "01.bmp"。您可能没有写入权限。可能性1:可能是路径的文件名中有中文,将路径名中的中文部分改成英文可能性2:可能写入的地址是绝对路径,改成相对路径...
2020-05-16 14:14:04
10260
原创 4.20 PAT 甲级 1021 Deepest Root
A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root ...
2020-04-20 11:09:33
183
原创 4.20 PAT 甲级 1020 Tree Traversals
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the cor...
2020-04-20 09:44:07
179
原创 4.19 PAT 甲级 1004 Counting Leaves
A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts...
2020-04-19 10:14:03
125
原创 4.14 PAT 甲级 1052 Linked List Sorting
A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integerkeyand aNextpointer to the next structure. Now give...
2020-04-14 10:24:58
134
原创 4.13 PAT 甲级 1075 PAT Judge
The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT.Input Specification:Each input file co...
2020-04-13 21:58:11
145
原创 4.13 PAT 甲级 1039 Course List for Student
Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes ...
2020-04-13 11:11:58
116
原创 4.13 PAT 甲级 1028 List Sorting
Excel can sort records according to any column. Now you are supposed to imitate this function.Input Specification:Each input file contains one test case. For each case, the first line contains two...
2020-04-13 10:10:32
133
原创 4.13 PAT 甲级 1025 PAT Ranking
Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklists w...
2020-04-13 09:32:32
83
原创 4.12 背包问题总结
01背包问题和完全背包问题在https://blog.csdn.net/qq_39782006/article/details/105420831多重背包问题有N种物品和一个容量是V的背包。第i种物品最多有 si件,每件体积是 vi,价值是 wi。求解将哪些物品装入背包,可使物品体积总和不超过背包容量,且价值总和最大。输出最大价值。输入格式第一行两个整...
2020-04-12 15:57:09
103
原创 4.11 PAT 甲级 1022 Digital Library
A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number a...
2020-04-11 22:28:23
94
原创 4.11 PAT 甲级 1012 The Best Rank(涉及二分模板)
To evaluate the performance of our first year CS majored students, we consider their grades of three courses only:C- C Programming Language,M- Mathematics (Calculus or Linear Algrbra), andE- Eng...
2020-04-11 20:42:53
84
原创 4.11 PAT 甲级 1098 Insertion or Heap Sort
According to Wikipedia:Insertion sortiterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data,...
2020-04-11 12:33:10
92
原创 4.9-4.11 闫氏dp分析法
那啥 写这篇只是想总结一下白天听课的成果。强推一个up 大雪菜 一开始就是找一个什么算法的时候搜到这个up的视频,后来发现这个up讲东西讲的特别清楚,而且是他是真的牛逼,还有自己的网站 Acwing,里面可以刷题啊之类的,还有很多课很多活动啥啥的······多厉害不讲了,回到这里,我听的课是https://www.bilibili.com/video/BV1X741127ZM?t=2703...
2020-04-09 22:42:37
376
原创 4.9 PAT 甲级 1100 Mars Numbers
People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earth is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, ...
2020-04-09 14:28:46
113
原创 4.9 PAT 甲级 1027 Colors in Mars
People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are forRed, the middle 2 dig...
2020-04-09 10:43:31
120
原创 4.9 PAT 甲级 1015 Reversible Primes
Areversible primein any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also a pr...
2020-04-09 10:31:51
121
原创 ???4.8/4.9 PAT 甲级 1010 Radix
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer isyes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive inte...
2020-04-09 08:09:24
102
原创 4.8 PAT 甲级 1024 Palindromic Number
A number that will be the same when it is written forwards or backwards is known as aPalindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers...
2020-04-08 18:49:22
80
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅