![](https://img-blog.csdnimg.cn/2019091813595558.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
刷子刷题
不刷会落灰,面试会吃亏
最近都更新到本地了
科学严谨
展开
-
算法笔记之:大整数的四则运算
带来《算法笔记》第五章:大整数的四则运算#include<cstdio>#include<cstring>struct bign{ int d[1000]; int len; bign(){ memset(d,0,sizeof(d)); len=0; } ...原创 2018-05-09 11:46:02 · 838 阅读 · 0 评论 -
PAT甲级1009 多项式相乘
题目This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the inform...原创 2018-09-19 23:10:09 · 202 阅读 · 0 评论 -
PAT甲级1010 (进制和二分法)
题目Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is “yes”, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive ...原创 2018-09-21 07:48:48 · 1561 阅读 · 1 评论 -
PAT甲级1015 素数
题目A reversible prime in 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...原创 2018-09-26 23:38:03 · 332 阅读 · 0 评论 -
PAT甲级1012 (结构体,排序)
题目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 Algebra), and E – ...原创 2018-09-22 11:56:18 · 1661 阅读 · 0 评论 -
PAT甲级1013 (图,DFS举例详解)
题目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 ...原创 2018-09-22 21:57:22 · 1714 阅读 · 0 评论 -
PAT甲级1022 map、set的使用
题目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 numbe...原创 2018-10-13 19:16:43 · 521 阅读 · 0 评论 -
PAT甲级1023 大整数加法
题目题解 #include&lt;iostream&gt;#include&lt;cstring&gt;using namespace std;int book[10];int main(){ char num[22]; scanf("%s",num); int flag=0; int len=strlen(num); for(int i=len-1;...原创 2018-10-13 23:31:17 · 566 阅读 · 0 评论 -
PAT甲级1016 (map,排序)
首先记录是否成对是的话,上线要在下线前。每个月份的要在一起原创 2018-09-29 12:34:15 · 1075 阅读 · 0 评论 -
PAT甲级1024 ASCII码与整数转换
题目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 single digit numbers are palindromic numb...原创 2018-10-15 17:21:55 · 376 阅读 · 0 评论 -
PAT甲级1017 (模拟排序)
课前分析感觉和1016差不多, 就模拟一下几个队列, 有空位立即插入并计算等待时间, 没空位计算最早处理完的用户的离去时间,并更新为当前时间等等。(1) vector a(10); //定义了10个整型元素的向量(尖括号中为元素类型名,它可以是任何合法的数据类型),但没有给出初值,其值是不确定的。(2)vector a(10,1); //定义了10个整型元素的向量,且给出每个元素的初值为1...原创 2018-10-09 09:52:35 · 1018 阅读 · 0 评论 -
PAT甲级1019 回文数
题目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 single digit numbers are palindromic numb...原创 2018-10-10 09:30:20 · 217 阅读 · 0 评论 -
PAT甲级1115 DFS和BST
题目A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than or equal to the node’s key....原创 2018-11-04 18:25:49 · 191 阅读 · 0 评论 -
PAT甲级1064 log()函数的换底公式 BST 递归
题目A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than the node’s key.The right s...原创 2018-11-05 22:26:56 · 313 阅读 · 0 评论 -
PAT甲级1007 最大连续子序列
题目Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1 &amp;lt;= i &amp;lt;= j &amp;lt;= K. The Maximum Subsequence is the continuous subsequenc...原创 2018-09-18 23:16:04 · 159 阅读 · 0 评论 -
PAT甲级1005 字符串的处理
题目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 contains one test case. Ea...原创 2018-09-18 17:49:35 · 250 阅读 · 0 评论 -
PAT甲级1008
1008 Elevator (20)(20 分) The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in speci...原创 2018-08-14 10:27:22 · 237 阅读 · 0 评论 -
PAT甲级1006
1006 Sign In and Sign Out (25)(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 ...原创 2018-08-14 10:29:23 · 155 阅读 · 0 评论 -
PAT甲级1020(附带前中序遍历の绝对干货)
引子我之前对遍历推导这块没怎么动脑子,凭感觉。所以这题是先参考了百度经验,别笑,这个链接,我觉得讲得非常清楚。 https://jingyan.baidu.com/article/cdddd41cb8d79753ca00e144.html 读懂它的前提是,你静下心来,而不是像找规律一样,似是而非地懂了。那样毫无卵用。通过推导它再举一反三推导其他题,你发现,思路是:先通过后序的特点,...原创 2018-08-14 16:32:20 · 1198 阅读 · 0 评论 -
PAT甲级1054 map的使用
题目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 larges...原创 2018-08-26 23:54:17 · 381 阅读 · 0 评论 -
PAT甲级1027
题目1027 Colors in Mars (20)(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 ...原创 2018-08-20 23:12:19 · 144 阅读 · 0 评论 -
PAT甲级1036
题目1036 Boys vs Girls (25)(25 分) This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.Input Specificati...原创 2018-08-21 14:19:09 · 124 阅读 · 0 评论 -
PAT甲级1051 栈的模拟
题目1051 Pop Sequence (25)(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...原创 2018-08-21 23:59:17 · 400 阅读 · 0 评论 -
PAT甲级1056(queue的用法)
题目1056 Mice and Rice(25 分) Mice and Rice is 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 eac...原创 2018-08-29 18:03:28 · 869 阅读 · 0 评论 -
PAT甲级1058(进制转换的“/” ,“%”干货!)
题目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 Galleo...原创 2018-08-30 10:37:26 · 246 阅读 · 0 评论 -
PAT甲级1001 字符串处理
题目1001 A+B Format (20 分) Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input ...原创 2018-09-16 16:29:25 · 173 阅读 · 0 评论 -
PAT甲级1002 多项式相加
题目This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each case occupies 2 lines, and each line contains the information of a p...原创 2018-09-16 23:44:16 · 148 阅读 · 0 评论 -
PAT甲级 1003 Dijkstra的口诀干货
题目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 in each city and t...原创 2018-09-17 17:55:35 · 643 阅读 · 0 评论 -
PAT甲级1004 (DFS,树的父子节点)
题目A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.InputEach input file contains one test case. Each case starts with a line c...原创 2018-09-18 11:46:38 · 281 阅读 · 0 评论 -
PAT甲级1011
1011 World Cup Betting (20)(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 W...原创 2018-08-14 10:25:08 · 182 阅读 · 0 评论