pat考试
文章平均质量分 88
Eaco1412
这个作者很懒,什么都没留下…
展开
-
1021 Deepest Root (25 分)
原题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 is calledthe deepest root.Input Specification:E.原创 2021-09-01 10:08:28 · 71 阅读 · 0 评论 -
1013 Battle Over Cities (25 分)
原题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 t原创 2021-08-30 22:05:44 · 121 阅读 · 0 评论 -
1107 Social Clusters (30 分)
原题When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. Asocial clusteris a set of people who have some of their hobbies in common. You are supposed to find all th..原创 2021-08-28 18:17:13 · 83 阅读 · 0 评论 -
1070 Mooncake
原题Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now given the inventory amounts and the prices of all ki原创 2021-08-26 15:41:08 · 59 阅读 · 0 评论 -
1038 Recover the Smallest Number (30 分)
原题Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover many numbers such like 32-321-3214-0229-87 or 0229-32-87-321-3214 with respect to different原创 2021-08-25 22:22:17 · 130 阅读 · 0 评论 -
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 the value of that product back! What is more, the shop also of原创 2021-08-25 13:29:19 · 76 阅读 · 0 评论 -
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 car is limited, we have to find gas stations on the way from time to time. Different gas station may give different price. You are asked to原创 2021-08-24 19:04:16 · 108 阅读 · 0 评论 -
C/C++实用语法(针对pat考试的复习)
虽然学过C和C++但是好久没写语法都生疏了,才会像上一篇文章一样避开很多简便方法,为了之后写代码能稍微高效一些,必须整理一下实用语法(以《算法笔记》为学习材料,针对本人本次pat考试进行整理,代码采用C++中包含C的形式)。基本类型int整型绝对值在10^9(包括10^9)范围内的整数都可以定义成int类型。long long长整型范围(大于2147483647)不好记,就把超过10^9的都定义成long long吧。double浮点型单精度float的精度不够,碰到浮点型数据都原创 2021-08-22 03:04:35 · 517 阅读 · 0 评论 -
PAT 1001 A+B Format
(查看最终代码请直接看最后一个代码段)还有两周考pat,好久没写c++代码了,极限刷题一波,看看有没有机会抱佛大腿。题目1001 A+B Format (20 分)Calculatea+band 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)...原创 2021-08-19 12:01:54 · 65 阅读 · 0 评论