2 tqlwsl

尚未进行身份认证

欢迎来到英雄联盟。

等级
TA的排名 8w+

1138 Postorder Traversal (25 分)

1138Postorder Traversal(25分)Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to output the first nu...

2019-07-04 16:35:19

憨憨题1142 Maximal Clique (25 分)

1142Maximal Clique(25分)Acliqueis a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. Amaximal cliqueis a clique that cannot be exten...

2019-07-04 14:55:32

1146 Topological Order (25 分)

1146Topological Order(25分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are sup...

2019-07-03 16:36:40

1150 Travelling Salesman Problem (25 分)

1150Travelling Salesman Problem(25分)The "travelling salesman problem" asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest pos...

2019-07-03 15:09:22

1098 Insertion or Heap Sort (25 分)

1098Insertion or Heap Sort(25分)According to Wikipedia:Insertion sortiterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort rem...

2019-07-02 17:29:04

1147 Heaps (30 分)

1147Heaps(30分)In computer science, aheapis a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater...

2019-07-02 15:35:19

【PAT A1154】Vertex Coloring (25 分)

1154Vertex Coloring(25分)Aproper vertex coloringis a labeling of the graph's vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at mostk...

2019-07-02 14:24:07

【PAT A1155】Heap Paths (30 分)

1155Heap Paths(30分)In computer science, aheapis a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either gr...

2019-07-01 22:44:25

【PAT刷题】一个小妙招,缩短近一半运行时间

cmp函数上改动一点点。原理很简单,传引用比传值快很多。两者区别只在于形参的写法不用~1.传引用,只需要64ms。bool cmp(const node &a, const node &b){ return a.sco == b.sco ? a.id < b.id : a.sco > b.sco;}2.传值,需要103ms。bo...

2019-05-21 23:23:27

1019 General Palindromic Number (20 分)

1019General Palindromic Number(20分)A number that will be the same when it is written forwards or backwards is known as aPalindromic Number. For example, 1234321 is a palindromic number. All sin...

2019-05-18 08:58:43

1015 Reversible Primes (20 分)

1015Reversible Primes(20分)Areversible primein 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 bec...

2019-05-16 22:51:12

1012 The Best Rank (25 分)

1012The Best Rank(25分)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 ...

2019-05-16 16:37:34

刷完PAT乙级的个人经验总结

刷乙级时无论是水题还是难题博主都写了博客,在这个过程中学到了一些知识,也分出了很多时间来写博客。所以为了平衡时间和写题效率,以后只有博主觉得能get到新技能时才会写新博客。1.写博客的确是一种很好的学习方法,道理大家都懂,尝试向他人讲授知识时理解会加深。对于一道题,如果觉得说不清楚 or 觉得只可意会不可言传 or 写不出解题步骤,其实还是自己没有真正地捋清思路,没有真正的会做这题...

2019-05-16 10:54:35

1010 Radix (25 分)

1010Radix(25分)Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer isyes, if 6 is a decimal number and 110 is a binary number.Now for any p...

2019-05-16 09:58:19

1006 Sign In and Sign Out (25 分)

1006Sign 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 rec...

2019-05-14 12:58:58

1001 A+B Format (20 分)

1001A+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).Input Sp...

2019-05-14 11:40:23

【PAT B1029】旧键盘 (20 分)

1029旧键盘(20分)旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现。现在给出应该输入的一段文字、以及实际被输入的文字,请你列出肯定坏掉的那些键。输入格式:输入在 2 行中分别给出应该输入的文字、以及实际被输入的文字。每段文字是不超过 80 个字符的串,由字母 A-Z(包括大、小写)、数字 0-9、以及下划线_(代表空格)组成。题目保证 2 个字符串均非空...

2019-05-07 23:15:51

【PATB 1028】人口普查 (20 分)

1028人口普查(20分)某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 200 岁的老人,而今天是 2014 年 9 月 6 日,所以超过 200 岁的生日和未出生的生日都是不合理的,应该被过滤掉。输入格式:输入在第一行给出正整数N,取值在(0,10​5​​...

2019-05-07 22:39:57

【PAT B1020】月饼 (25 分)

1020月饼(25分)月饼是中国人在中秋佳节时吃的一种传统食品,不同地区有许多不同风味的月饼。现给定所有种类月饼的库存量、总售价、以及市场的最大需求量,请你计算可以获得的最大收益是多少。注意:销售时允许取出一部分库存。样例给出的情形是这样的:假如我们有 3 种月饼,其库存量分别为 18、15、10 万吨,总售价分别为 75、72、45 亿元。如果市场的最大需求量只有 20 万吨,那...

2019-05-06 13:10:07

模拟题【PAT B1018】锤子剪刀布 (20 分)

1018锤子剪刀布(20分)大家应该都会玩“锤子剪刀布”的游戏:两人同时给出手势,胜负规则如图所示:现给出两人的交锋记录,请统计双方的胜、平、负次数,并且给出双方分别出什么手势的胜算最大。输入格式:输入第 1 行给出正整数N(≤10​5​​),即双方交锋的次数。随后N行,每行给出一次交锋的信息,即甲、乙双方同时给出的的手势。C代表“锤子”、J代表“剪刀”、B...

2019-05-06 12:15:36

查看更多

勋章 我的勋章
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 勤写标兵Lv3
    勤写标兵Lv3
    授予每个自然周发布7篇到8篇原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。