*PAT_甲级_1053 Path of Equal Weight (30分) (C++)【数组排序/DFS】
目录1,题目描述 题目大意输入输出2,思路数据结构 如何排序 如何设计DFS算法3,心路历程4,代码1,题目描述 Sample Input:20 9 2410 2 4 3 5 10 2 18 9 7 2 2 1 3 12...
PAT甲级1103 Integer Factorization【dfs】【剪枝】
题目:https://pintia.cn/problem-sets/994805342720868352/problems/994805364711604224题意:给定一个数n,要求从1~n中找出k个数,使得这些数的p次方之和等于n思路:因为n为400,所以dfs加剪枝【本来还在想dp来着】他要求...
PAT 甲级 1035 Password (20 分)
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 ...
PAT 甲级 1041 Be Unique (20 分)
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...
PAT甲级——1033 To Fill or Not to Fill
1033 To Fill or Not to FillWith highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is lim...
PAT甲级1033. To Fill or Not to Fill
PAT甲级1033. To Fill or Not to Fill题意:有了高速公路,从杭州到任何其他城市开车很容易。但由于一辆汽车的坦克容量有限,我们不得不在不时地找到加油站。不同的加油站可能会给不同的价格。您被要求仔细设计最便宜的路线。输入规格:每个输入文件包含一个测试用例。对于每种情况,第一行...
PAT 甲级 1033 To Fill or Not to Fill (25 分)(贪心,误以为动态规划,忽视了油量问题)*
1033 To Fill or Not to Fill (25 分) With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a ca...
PAT 甲级 1010 Radix
https://pintia.cn/problem-sets/994805342720868352/problems/994805507225665536Given a pair of positive integers, for example, 6 and 110, can this equat...
PAT 甲级 1020 Tree Traversals
https://pintia.cn/problem-sets/994805342720868352/problems/994805485033603072Suppose that all the keys in a binary tree are distinct positive integers...
PAT 甲级 1020 Tree Traversals (二叉树遍历)
1020. Tree Traversals (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueSuppose that all the keys in a binary tree are distinct positive i...
PAT 甲级 1078 Hashing
https://pintia.cn/problem-sets/994805342720868352/problems/994805389634158592Thetaskofthisproblemissimple:insertasequenceofdistinctpositiveintegersint...
PAT 甲级 1026 Table Tennis (30 分)(坑点很多,逻辑较复杂,做了1天)
1026 TableTennis (30 分) AtabletennisclubhasNtablesavailabletothepublic.Thetablesarenumberedfrom1toN.Foranypairofplayers,iftherearesometablesopenwhenth...
PAT甲级1017. Queueing at Bank
PAT甲级1017.QueueingatBank题意:假设一家银行有K台开放服务。窗前有一条黄线,将等候区分为两部分。所有的客户都必须在黄线后面排队,直到他/她轮到服务,并有一个可用的窗口。假设一个客户不能占用1个小时以上的窗口。现在考虑到每个客户的到达时间T和处理时间P,您应该告诉所有客户的平均等...
PAT甲级真题及训练集(18)--1097. Deduplication on a Linked List (25)
1097.DeduplicationonaLinkedList(25)时间限制300ms内存限制65536kB代码长度限制16000B判题程序Standard作者CHEN,YueGivenasinglylinkedlistLwithintegerkeys,youaresupposedtoremove...
浙大PAT甲级 1061
简单题,先用map<int,string>现将星期与星期的英文相对应。然后根据题意查找相等的字符。AC代码:#include<iostream>#include<map>#include<cstdio>#include<algorithm>...
PAT甲级1135 Is It A Red-Black Tree?【dfs】
题目:https://pintia.cn/problem-sets/994805342720868352/problems/994805346063728640题意:给定一棵二叉搜索树的先序遍历结果,问这棵树是不是一棵红黑树。思路:首先需要明确二叉搜索树和红黑树的性质。二叉搜索树的每个节点,左子树上...
PAT甲级——A1117 Eddington Number【25】
BritishastronomerEddingtonlikedtorideabike.Itissaidthatinordertoshowoffhisskill,hehasevendefinedan"Eddingtonnumber", E --thatis,themaximuminteger E su...
PAT甲级——A1026 Table Tennis
AtabletennisclubhasNtablesavailabletothepublic.Thetablesarenumberedfrom1toN.Foranypairofplayers,iftherearesometablesopenwhentheyarrive,theywillbeassig...
PAT 甲级 1117 Eddington Number
https://pintia.cn/problem-sets/994805342720868352/problems/994805354762715136BritishastronomerEddingtonlikedtorideabike.Itissaidthatinordertoshowoffhi...
PAT 甲级 1019 General Palindromic Number(简单题)
1019.GeneralPalindromicNumber(20)时间限制400ms内存限制65536kB代码长度限制16000B判题程序Standard作者CHEN,YueAnumberthatwillbethesamewhenitiswrittenforwardsorbackwardsiskno...