- 博客(89)
- 资源 (1)
- 收藏
- 关注
原创 PAT 1096 Consecutive Factors python解法
1096 Consecutive Factors (20 分)Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, and 7 are the three...
2019-01-23 16:06:53
489
4
原创 PAT 1152 Google Recruitment python解法
1152 Google Recruitment (20 分)In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is super-simple, a URL con...
2019-01-21 16:11:21
267
2
原创 PAT 1132 Cut Integer python解法
1132 Cut Integer (20 分)Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B ...
2019-01-21 10:44:00
313
2
原创 PAT 1081 Rational Sum python解法
1081 Rational Sum (20 分)Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum.Input Specification:Each input file contains one test case. Each case sta...
2019-01-20 17:18:24
265
原创 PAT 1046 Shortest Distance python解法
1046 Shortest Distance (20 分)The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input Specific...
2019-01-20 00:06:59
352
原创 PAT 1035 Password python解法
1035 Password (20 分)To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distingui...
2019-01-19 21:07:06
239
原创 PAT 1100 Mars Numbers python解法
1100 Mars Numbers (20 分)People on Mars count their numbers with base 13:Zero on Earth is called “tret” on Mars.The numbers 1 to 12 on Earch is called “jan, feb, mar, apr, may, jun, jly, aug, sep, o...
2019-01-18 22:02:05
268
原创 PAT 1136 A Delayed Palindrome python解法
1136 A Delayed Palindrome (20 分)Consider a positive integer N written in standard notation with k+1 digits ai as aki ⋯a1 a0 with 0 ≤ ai < 10 for all i and ak > 0. Then N is pa...
2019-01-16 11:50:54
239
原创 PAT 1019 General Palindromic Number python解法
1019 General Palindromic Number (20 分)A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All singl...
2019-01-16 11:15:31
250
原创 PAT 1104 Sum of Number Segments python解法
1104 Sum of Number Segments (20 分)Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we have 10 segmen...
2019-01-15 13:51:48
273
原创 PAT 1069 The Black Hole of Numbers python解法
1069 The Black Hole of Numbers (20 分)For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order,...
2019-01-13 21:09:53
285
原创 PAT 1073 Scientific Notation python解法
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...
2019-01-13 19:30:54
298
原创 快速将英文PDF翻译为中文
总结一下流程:先将pdf转换为html(如果pdf不可编辑的,先百度"pdf password remover"),然后用谷歌浏览器打开右键翻成中文,over。下面是一堆废话,可以不看。今天需要翻译一篇英文文档,有57页,开始想的是一点一点复制去谷歌翻译,到谷歌翻译后发现有一个文档翻译,开心的上传文件之后就没下文了,因为使用文档翻译需要翻墙。于是继续一点一点复制翻译,翻译了几页以后感觉好累,按...
2019-01-13 16:15:40
3741
原创 PAT 1023 Have Fun with Numbers python解法
1023 Have Fun with Numbers (20 分)Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happen...
2019-01-12 21:04:53
449
原创 PAT 1005 Spell It Right python解法
1005 Spell It Right (20 分)Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file co...
2019-01-12 17:00:09
297
原创 PAT 1031 Hello World for U python解法
1031 Hello World for U (20 分)Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as:h de ll rlowoThat is, ...
2019-01-11 17:44:43
313
原创 使用you-get批量下载b站视频
官方详细中文说明需要安装python,然后pip install you-get。安装步骤在官方说明上很清楚,就不写了。使用you-get --playlist -o F:\bilibili https://www.bilibili.com/video/av6731067批量下载视频到F:\bilibili...
2019-01-11 09:11:44
25925
3
原创 PAT 1116 Come on! Let's C python解法
1116 Come on! Let’s C (20 分)“Let’s C” is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun,...
2019-01-10 21:03:25
235
2
原创 python中4位16进制数与float浮点数互相转换
import structs = 'F4CEF042'#&amp;lt;是小端,&amp;gt;是大端,f代表16进制print(struct.unpack('&amp;lt;f', bytes.fromhex(s))[0])#输出:120.40420532226562
2019-01-10 11:04:46
17003
3
原创 python刷PAT超时怎么办
1.优化代码,降低复杂度2.有一些python内置函数比较耗时,尝试换一种方式, 比如求a集合是不是b集合的父集可以转换为求b集合是不是a集合的子集,(将a.issuperset(b)转换为b.issubset(a))3.删掉中文...
2019-01-09 22:23:22
863
原创 PAT 1149 Dangerous Goods Packaging python解法
1149 Dangerous Goods Packaging (25 分)When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious troub...
2019-01-09 22:17:05
286
原创 PAT 1050 String Subtraction python解法
1050 String Subtraction (20 分)Given two strings S1 and S2 , S=S1−S2 is defined to be the remaining string after taking all the characters in S2 from S1 . Your task is si...
2019-01-09 09:59:15
306
原创 PAT 1037 Magic Coupon python解法
1037 Magic Coupon (25 分)The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times th...
2019-01-09 09:36:35
300
原创 PAT 1124 Raffle for Weibo Followers python解法
1124 Raffle for Weibo Followers (20 分)John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo – that is, he would select winners from every N foll...
2019-01-08 21:07:23
213
原创 PAT 1063 Set Similarity python解法
1063 Set Similarity (25 分)Given two sets of integers, the similarity of the sets is defined to be Nc/Nt×100%, where Nc is the number of distinct common numbers shared by the two sets, and Nt i...
2019-01-08 15:42:24
242
原创 PAT 1042 Shuffling Machine python解法
1042 Shuffling Machine (20 分)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 empl...
2019-01-08 13:59:14
338
原创 PAT 1058 A+B in Hogwarts python解法
1058 A+B in Hogwarts (20 分)If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid explained it to Harry, “Seventeen silver Sickles to a Galleon an...
2019-01-08 10:15:14
272
原创 PAT 1041 Be Unique python解法
1041 Be Unique (20 分)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 ...
2019-01-07 19:48:51
257
原创 PAT 1084 Broken Keyboard python解法
1084 Broken Keyboard (20 分)On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on screen.Now given a stri...
2019-01-07 16:15:20
253
原创 PAT 1006 Sign In and Sign Out python解法
1006 Sign In and Sign Out (25 分)At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the recor...
2019-01-07 15:37:58
304
原创 PAT 1125 Chain the Ropes python解法
1125 Chain the Ropes (25 分)Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by th...
2019-01-07 14:47:44
154
原创 PAT 1120 Friend Numbers python解法
1120 Friend Numbers (20 分)Two integers are called “friend numbers” if they share the same sum of their digits, and the sum is their “friend ID”. For example, 123 and 51 are friend numbers since 1+2+3...
2019-01-07 11:50:43
213
原创 PAT 1092 To Buy or Not to Buy python解法
1092 To Buy or Not to Buy (20 分)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...
2019-01-07 11:36:16
172
原创 PAT 1027 Colors in Mars python解法
1027 Colors in Mars (20 分)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 ar...
2019-01-07 11:21:36
213
原创 PAT 1083 List Grades python解法
1083 List Grades (25 分)Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student reco...
2019-01-07 11:09:01
239
原创 PAT 1011 World Cup Betting python解法
1011 World Cup Betting (20 分)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 ...
2019-01-07 10:59:07
414
原创 PAT 1054 The Dominant Color python解法
1054 The Dominant Color (20 分)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 pr...
2019-01-06 22:01:37
390
原创 PAT 1140 Look-and-say Sequence python解法
1140 Look-and-say Sequence (20 分)Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, …where D is in [0, 9] except 1. The (n+1)st number is a kind...
2019-01-06 21:49:57
298
原创 MNIST手写识别进阶,使用有一层隐含层的全连接神经网络
https://blog.csdn.net/qq_36936510/article/details/85242665在上文的基础上,增加了一层隐含层,以及使用了Dropout、Adagrad、ReLU等方法,将MNIST手写识别的准确率提升到了98%。from tensorflow.examples.tutorials.mnist import input_dataimport tensor...
2019-01-05 16:37:41
1694
原创 PAT 1003 Emergency python解法
1003 Emergency (25 分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams ...
2018-12-26 19:14:12
581
2
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅