
PAT
文章平均质量分 57
浮生一朝
这个作者很懒,什么都没留下…
展开
-
1021. Deepest Root (25)(dfs+并查集)
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 i原创 2017-11-29 20:28:00 · 280 阅读 · 0 评论 -
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 in each city and the le原创 2017-11-15 21:15:06 · 231 阅读 · 0 评论 -
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 happens to be another 9-digit number cons原创 2017-11-30 20:41:35 · 1129 阅读 · 0 评论 -
PAT 1057. Stack (30)
Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element onto the top position) and Pop原创 2017-12-02 21:54:36 · 265 阅读 · 0 评论 -
1056. Mice and Rice (25)PAT
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 each mouse is t原创 2017-12-05 17:26:15 · 359 阅读 · 0 评论 -
1060. Are They Equal (25)
If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123*105 with simple chopping. Now given the number of significan转载 2017-12-08 09:43:11 · 219 阅读 · 0 评论 -
L2-010. 排座位(并查集)
布置宴席最微妙的事情,就是给前来参宴的各位宾客安排座位。无论如何,总不能把两个死对头排到同一张宴会桌旁!这个艰巨任务现在就交给你,对任何一对客人,请编写程序告诉主人他们是否能被安排同席。输入格式:输入第一行给出3个正整数:N(<= 100),即前来参宴的宾客总人数,则这些人从1到N编号;M为已知两两宾客之间的关系数;K为查询的条数。随后M行,每行给出一对宾客之间的关系,格式为:“宾客...原创 2018-03-13 10:33:57 · 229 阅读 · 0 评论