
PAT
文章平均质量分 80
realxuejin
c/c 算法 网络
展开
-
【PAT】1058. A+B in Hogwarts (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1058分析:注意输入格式即可简单解题。题目描述:If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid expla原创 2013-08-22 21:30:51 · 1365 阅读 · 0 评论 -
【PAT】1035. Password (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1035分析:简单题。直接搜索,然后替换,不会超时,但是应该有更好的办法。题目描述:To prepare for PAT, the judge sometimes has to generate random passwords for the users. The probl原创 2013-08-22 16:58:06 · 1011 阅读 · 1 评论 -
【PAT】1007. Maximum Subsequence Sum (25)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1007分析:(1)求最大连续子序列,最终输出最大子序列值以及子序列起始和终止元素。如果数组全为负数,则输出0以及数组的第一个和最后一个元素。(2)一个特殊情况。如,输入的是: 4 -1 0 0 -1 那么我们输出的应该是: 0 0 0原创 2013-08-23 16:11:58 · 1758 阅读 · 0 评论 -
【PAT】1009. Product of Polynomials (25)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1009分析:简单题。相乘时指数相加,系数相乘即可,输出时按指数从高到低的顺序。注意点:多项式相乘后指数最高可达2000。题目描述:This time, you are supposed to find A*B where A and B are two polynomials原创 2013-08-23 17:07:04 · 1607 阅读 · 0 评论 -
【PAT】1031. Hello World for U (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1031分析:简单题,调整数组的输出次序就可以了。输入数组长度为len。n1 = n3 = (len+2)/3; n2 = len - n1 - n3;第一行最左边对应的是原数组的第一个字符,最后边对应的是原数组的最后一个字符。总共输出n1行。题目描述:原创 2013-08-22 15:53:21 · 893 阅读 · 0 评论 -
【PAT】1059. Prime Factors (25)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1059题目描述:Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1^k1 * p2^k2 *…*p原创 2013-08-26 20:30:23 · 1467 阅读 · 0 评论 -
【PAT】1048. Find Coins (25)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1048题目描述:Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shoppin原创 2013-08-26 19:44:58 · 1771 阅读 · 0 评论 -
【PAT】1027. Colors in Mars (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1027简单题,考察十进制数和n进制数的转换和输出格式的控制。People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a co原创 2013-08-22 15:14:45 · 834 阅读 · 0 评论 -
【PAT】1012. The Best Rank (25)
题目链接: http://pat.zju.edu.cn/contests/pat-a-practise/1012题目描述:To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programm原创 2013-08-27 11:37:46 · 2989 阅读 · 0 评论 -
【PAT】1051. Pop Sequence (25)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1051题目描述:Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to原创 2013-08-27 19:40:08 · 1491 阅读 · 0 评论 -
【PAT】1055. The World's Richest (25)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1055题目描述:Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you原创 2013-08-28 08:01:06 · 1874 阅读 · 0 评论 -
【PAT】1010. Radix (25)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1010题目描述:Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal原创 2013-08-29 09:20:04 · 1626 阅读 · 0 评论 -
【PAT】1050 String Substraction
怎么样快速的查询时关键,使用暴搜一定会超时的。题目链接:http://pat.zju.edu.cn/contests/pat-101-103-1-2013-03-10/AA. String Subtraction (20)时间限制 10 ms内存限制 32000 kB代码长度限制 8000 B判题程序原创 2013-08-15 19:08:24 · 1107 阅读 · 0 评论 -
【PAT】1008. Elevator (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1008简单题。电梯上升要6s,下降要4s,每个stop停靠5s,相加就好。时间限制 400 ms内存限制 32000 kB代码长度限制 16000 B判题程序 Standard 作者 CHEN,原创 2013-08-21 08:09:14 · 1598 阅读 · 0 评论 -
【PAT】1019. General Palindromic Number (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1019简单题。将十进制数a转换成以b为奇数的数,判断转换后的数是否是符合回文串的特点。A number that will be the same when it is written forwards or backwards is known as a Palindrom原创 2013-08-21 16:15:19 · 1217 阅读 · 0 评论 -
【PAT】1013. Battle Over Cities (25)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1013题目描述: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原创 2013-08-29 15:29:42 · 3716 阅读 · 1 评论 -
【PAT】1011. World Cup Betting (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1011简单题。照着题目给出的公式计算就可以。With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best play原创 2013-08-21 09:14:07 · 1085 阅读 · 0 评论 -
【PAT】1023. Have Fun with Numbers (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1023简单题。用俩个数组标记数字0~9出现的数次就可以了。Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplic原创 2013-08-21 16:52:07 · 1544 阅读 · 0 评论 -
【PAT】1015. Reversible Primes (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1015题目不难,就是表述不清楚,看的费劲。题目的意思是:给出一个数N和一个基数D。首先这个数必须是素数。其次,将这个数(1)转为D进制数(2)将这个D进制数反转(3)将反转后的数再转为十进制数,这个十进制数依然是素数。 这样我们就输出“Yes”。将十进制数转为n进制数:(待补充。原创 2013-08-21 15:33:19 · 1946 阅读 · 0 评论 -
【PAT】1028. List Sorting (25)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1028题目描述:Excel can sort records according to any column. Now you are supposed to imitate this function.InputEach input file contains one原创 2013-08-27 08:47:13 · 991 阅读 · 2 评论 -
【PAT】1042. Shuffling Machine (20)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1042 题目描述:Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and i原创 2013-10-24 20:16:43 · 1032 阅读 · 0 评论 -
【PAT】1066. Root of AVL Tree (25)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1066题目描述:An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at m原创 2013-10-19 16:16:52 · 3615 阅读 · 1 评论 -
【PAT】1064. Complete Binary Search Tree (30)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1066题目描述:An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at m原创 2013-10-19 15:51:46 · 1612 阅读 · 0 评论 -
【PAT】1041. Be Unique (20)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1041题目描述:Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: o原创 2013-08-26 21:29:47 · 968 阅读 · 0 评论 -
【PAT】1036. Boys vs Girls (25)
题目链接:http://pat.zju.edu.cn/contests/pat-a-practise/1036题目描述: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 fe原创 2013-10-26 09:10:13 · 1365 阅读 · 0 评论 -
【PAT】1017. Queueing at Bank (25)
有三组数据过不了,暂记于此#include#include#include#include#includeusing namespace std;struct node{ int h; int m; int s; int wait; int end; int process; double total;};struct record{ int wi原创 2013-10-27 15:46:58 · 895 阅读 · 0 评论 -
【PAT】1029. Median (25)
Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16, 17} is 15. The原创 2013-10-30 10:13:40 · 1004 阅读 · 0 评论 -
【PAT】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 ga原创 2013-10-31 15:58:03 · 1049 阅读 · 0 评论 -
【PAT】1054 The Diamond Color
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1054题目描述:Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an i原创 2013-08-22 20:31:39 · 875 阅读 · 0 评论 -
【PAT】1065. A+B and C (64bit) (20)
Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C.Input Specification:The first line of the input gives the positive number of test cases, T (Output Specif原创 2013-11-01 15:15:00 · 2026 阅读 · 0 评论 -
【PAT】1070. Mooncake (25)
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原创 2013-11-02 19:58:39 · 1603 阅读 · 0 评论 -
【PAT】1071. Speech Patterns (25)
People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down a speaker原创 2013-11-06 21:11:58 · 1666 阅读 · 0 评论 -
【PAT】1005 Spell It Right
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1005分析:简单题。将输入的字符串一个个的转换成数字再相加,然后将相加的结果用英文打印出来就可以。输入输出的顺序需要用到栈的知识。题目描述:Given a non-negative integer N, your task is to compute the sum of a原创 2013-08-23 09:30:36 · 1177 阅读 · 0 评论 -
【PAT】1006. Sign In and Sign Out (25)
PAT 解题报告原创 2013-08-23 11:08:38 · 1170 阅读 · 0 评论 -
PAT 题目分类
Note: PAT(甲级)题目的分类,根据刷题进度进行更新。字符串处理 1001, 1002, 1005结构体排序 1006原创 2015-09-04 21:03:27 · 1406 阅读 · 0 评论 -
【PAT】1002. A+B for Polynomials (25)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1002分析:给出俩个多项式的指数和系数,没有给出基数,只要将指数相同的多项式进行系数相加即可。输出时按照指数从高到低的顺序输出。 最后输出的结果原先是这样输出: printf(" %d% .1lf",i,input[i]);原创 2013-08-23 08:47:32 · 2512 阅读 · 0 评论 -
【PAT】1016. Phone Bills (25)
A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. Wh原创 2015-10-17 15:01:52 · 1306 阅读 · 1 评论 -
【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 Po原创 2015-11-03 21:59:19 · 434 阅读 · 0 评论 -
【PAT】 1076. Forwards on Weibo (30)
Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed with followers relations. When a原创 2015-11-04 09:49:22 · 448 阅读 · 0 评论 -
【PAT】1032. Sharing (25)
To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For example,原创 2013-10-30 17:03:54 · 918 阅读 · 0 评论