码迷,mamicode.com
首页 >  
搜索关键字:pat    ( 13517个结果
pat甲级1016
A long-distance telephone company charges its customers by the following rules: Making a long-distance call costs a certain amount per minute, dependi ...
分类:其他好文   时间:2018-08-19 16:16:17    阅读次数:205
【PAT】1015 德才论 (25)(25 分)
1015 德才论 (25)(25 分) 宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。” 现给出一批考生的德才分数,请根据司马光的理论给出录取排名。 输入格 ...
分类:其他好文   时间:2018-08-19 15:50:43    阅读次数:155
pat甲级1020中序后序求层序
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou ...
分类:其他好文   时间:2018-08-19 15:46:04    阅读次数:139
PAT乙级1016.部分A+B(15 分)
正整数 A 的“D?A??(为 1 位整数)部分”定义为由 A 中所有 D?A?? 组成的新整数 P?A??。例如:给定 8,D?A??=6,则 A 的“6 部分”P?A?? 是 66,因为 A 中有 2 个 6。 现给定 A、D?A??、B、D?B??,请编写程序计算 P?A??+P?B??。 输 ...
分类:其他好文   时间:2018-08-19 14:52:16    阅读次数:199
pyhton之os.path
目录结构 __file__ __file__表示了当前文件的path os.path.dirname(path) 去掉文件名,返回目录,若print os.path.dirname(file)所在脚本是以绝对路径运行的,则会输出该脚本所在的绝对路径,若以相对路径运行,输出空目录 os.path.ab ...
分类:其他好文   时间:2018-08-19 14:04:05    阅读次数:140
POJ 3259 Wormholes
Description While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one- ...
分类:其他好文   时间:2018-08-19 14:03:06    阅读次数:150
PAT乙级1014.福尔摩斯的约会 (20)(20 分)
大侦探福尔摩斯接到一张奇怪的字条:“我们约会吧! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm”。大侦探很快就明白了,字条上奇怪的乱码实际上就是约会的时间“星期四 14:04”,因为前面两字符串中第1对相同的大写英文字母(大小写有区分)是 ...
分类:其他好文   时间:2018-08-19 13:00:46    阅读次数:118
PAT 1064 Complete Binary Search Tree[二叉树][难]
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes ...
分类:其他好文   时间:2018-08-19 12:53:56    阅读次数:110
1002 A+B for Polynomials
试着用python做了一点PAT甲级的题目,前几题不难,比如1002 A+B for Polynomials,地址:https://pintia.cn/problem-sets/994805342720868352/problems/994805526272000000 python代码也不长,40 ...
分类:其他好文   时间:2018-08-19 00:49:45    阅读次数:180
PAT乙级1013.数素数
令P~i~表示第i个素数。现任给两个正整数M <= N <= 10^4^,请输出P~M~到P~N~的所有素数。 输入格式: 输入在一行中给出M和N,其间以空格分隔。 输出格式: 输出从P~M~到P~N~的所有素数,每10个数字占1行,其间以空格分隔,但行末不得有多余空格。 输入样例: 5 27 输出 ...
分类:其他好文   时间:2018-08-18 22:27:54    阅读次数:209
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!