贺巩山的博客

没有伞的孩子更要努力奔跑


  • 首页

  • 文件系统

  • Linux运维

  • 剑指Offer

  • LeetCode题解

  • PAT甲级题解

  • PAT乙级题解

  • CCF CSP题解

  • 分类

  • 标签

  • 归档

  • 书单

  • 关于

  • 搜索

PAT甲级 1036.Boys vs Girls (25 分)

发表于 2019-04-12 | 更新于 2019-04-12 | 分类于 pat甲级
字数统计: 582

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.

阅读全文 »

PAT甲级 1006.Sign In and Sign Out (25 分)

发表于 2019-04-11 | 更新于 2019-04-11 | 分类于 pat甲级
字数统计: 448

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 records of signing in’s and out’s, you are supposed to find the ones who have unlocked and locked the door on that day.

阅读全文 »

PAT甲级 1011.World Cup Betting (20 分)

发表于 2019-04-11 | 更新于 2019-04-11 | 分类于 pat甲级
字数统计: 479

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 World Cup trophy in South Africa. Similarly, football betting fans were putting their money where their mouths were, by laying all manner of World Cup bets.

Chinese Football Lottery provided a “Triple Winning” game. The rule of winning was simple: first select any three of the games. Then for each selected game, bet on one of the three possible results – namely W for win, T for tie, and L for lose. There was an odd assigned to each result. The winner’s odd would be the product of the three odds times 65%.

For example, 3 games’ odds are given as the following:

1
2
3
4
 W    T    L
1.1 2.5 1.7
1.2 3.1 1.6
4.1 1.2 1.1

To obtain the maximum profit, one must buy W for the 3rd game, T for the 2nd game, and T for the 1st game. If each bet takes 2 yuans, then the maximum profit would be (4.1×3.1×2.5×65%−1)×2=39.31 yuans (accurate up to 2 decimal places).

阅读全文 »

PAT乙级 1032.挖掘机技术哪家强 (20 分)

发表于 2019-04-11 | 更新于 2019-04-11 | 分类于 pat乙级
字数统计: 369

为了用事实说明挖掘机技术到底哪家强,PAT 组织了一场挖掘机技能大赛。现请你根据比赛结果统计出技术最强的那个学校。

阅读全文 »

PAT乙级 1028.人口普查 (20 分)

发表于 2019-04-10 | 更新于 2019-04-10 | 分类于 pat乙级
字数统计: 777

某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。

这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 200 岁的老人,而今天是 2014 年 9 月 6 日,所以超过 200 岁的生日和未出生的生日都是不合理的,应该被过滤掉。

阅读全文 »

PAT乙级 1004.成绩排名 (20 分)

发表于 2019-04-10 | 更新于 2019-04-10 | 分类于 pat乙级
字数统计: 462

读入 n(>0)名学生的姓名、学号、成绩,分别输出成绩最高和成绩最低学生的姓名和学号。

阅读全文 »

PAT乙级 1041.考试座位号 (15 分)

发表于 2019-04-10 | 更新于 2019-04-10 | 分类于 pat乙级
字数统计: 542

每个 PAT 考生在参加考试时都会被分配两个座位号,一个是试机座位,一个是考试座位。正常情况下,考生在入场时先得到试机座位号码,入座进入试机状态后,系统会显示该考生的考试座位号码,考试时考生需要换到考试座位就座。但有些考生迟到了,试机已经结束,他们只能拿着领到的试机座位号码求助于你,从后台查出他们的考试座位号码。

阅读全文 »

PAT甲级 1009.Product of Polynomials (25 分)

发表于 2019-04-08 | 更新于 2019-04-08 | 分类于 pat甲级
字数统计: 583

This time, you are supposed to find A×B where A and B are two polynomials.

阅读全文 »

PAT甲级 1002.A+B for Polynomials (25 分)

发表于 2019-04-08 | 更新于 2019-04-08 | 分类于 pat甲级
字数统计: 426

This time, you are supposed to find A+B where A and B are two polynomials.

阅读全文 »

PAT乙级 1010.一元多项式求导 (25 分)

发表于 2019-04-07 | 更新于 2019-04-07 | 分类于 pat乙级
字数统计: 449

设计函数求一元多项式的导数。(注:$x^n$(n为整数)的一阶导数为$nx^{n−1}$。)

阅读全文 »
1…404142…49
Gongshan He

Gongshan He

490 日志
62 分类
89 标签
GitHub 微博 知乎 Linkedin E-Mail
友情链接
  • 卢明冬的博客
  • lipixun
  • 柳婼 の blog
  • 心灵港
  • Liudeyin
© 2016 — 2023 Gongshan He
访问人数 总访问量 次