
刷题题解
文章平均质量分 93
倾鸢染
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Reversing Encryption(不同的思路:数学方法&&找规律)
题目描述A string s of length n can be encrypted by the following algorithm:iterate over all divisors of n in decreasing order (i.e. from n to 1),for each divisor d, reverse the substring s[1…d] (i.e. the substring which starts at position 1 and ends at posi原创 2020-10-15 11:33:26 · 252 阅读 · 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 t...原创 2019-08-28 11:56:02 · 186 阅读 · 0 评论 -
1006 Sign In and Sign Out
题目1006 Sign 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 re...原创 2019-08-29 17:05:47 · 147 阅读 · 0 评论 -
1007 Maximum Subsequence Sum
题目Given a sequence of K integers { N1, N2, …, NK}. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj} where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has t...原创 2019-08-29 19:01:29 · 157 阅读 · 0 评论 -
PAT程序设计甲级1005
PAT程序设计甲级1005题目1005 Spell It Right (20 分)Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:E...原创 2019-08-17 11:35:51 · 197 阅读 · 0 评论 -
PAT甲级1008
#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>using namespace std;int main(){ int n; while(~scanf("%d ",&n)) { int k=0,sum=0; int hx[103]; for(int i=0; i<n; i++) { scanf("%原创 2019-08-17 14:50:24 · 190 阅读 · 0 评论 -
PAT甲级1015 Reversible Primes
题目1015 Reversible Primes (20 分)A reversible prime in 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 be...原创 2019-08-17 16:13:46 · 192 阅读 · 0 评论 -
PAT甲级1011 World Cup Betting
PAT甲级1011题目1011 World Cup Betting (20 分)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 f...原创 2019-08-17 15:30:54 · 240 阅读 · 0 评论 -
PAT甲级1027 Colors in Mars
题目1027 Colors in Mars (20 分)People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits...原创 2019-08-18 09:03:00 · 161 阅读 · 0 评论 -
PAT甲级1031 Hello World for U
题目1031 Hello World for U (20 分)Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as:h de ll rlowoT...原创 2019-08-18 10:18:59 · 258 阅读 · 0 评论 -
PAT甲级1035 Password
题目1035 Password (20 分)To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distin...原创 2019-08-18 10:44:43 · 276 阅读 · 0 评论 -
PAT甲级1041 Be Unique
题目1041 Be Unique (20 分)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: one bets on a number chosen from [1,104...原创 2019-08-18 11:33:08 · 208 阅读 · 0 评论 -
PAT甲级1042 Shuffling Machine
题目1042 Shuffling Machine (20 分)Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid “inside jobs” where e...原创 2019-08-18 15:05:59 · 234 阅读 · 0 评论 -
PAT 1058 A+B in Hogwarts
题目1058 A+B in Hogwarts (20 分)If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid explained it to Harry, “Seventeen silver Sickles to a Galleon...原创 2019-08-20 14:57:56 · 151 阅读 · 0 评论 -
PAT甲级1054 The Dominant Color
题目1054 The Dominant Color (20 分)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 image, the color with the largest...原创 2019-08-18 15:55:34 · 264 阅读 · 0 评论 -
PAT甲级1050 String Subtraction
题目1050 String Subtraction (20 分)Given two strings S1 and S2 , S=S1−S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to calculate S1−S2...原创 2019-08-18 15:33:15 · 247 阅读 · 0 评论 -
PAT 1061 Dating
题目1061 Dating (20 分)Sherlock Holmes received a note with some strange strings: Let’s date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minute to figure out that...原创 2019-08-20 16:20:59 · 180 阅读 · 0 评论 -
PAT 1065 A+B and C (64bit)
题目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 positi...原创 2019-08-20 17:06:39 · 172 阅读 · 0 评论 -
PAT甲级 1069 The Black Hole of Numbers
题目1069 The Black Hole of Numbers (20 分)For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing ord...原创 2019-08-21 11:00:01 · 149 阅读 · 0 评论 -
2019.08.21刷题测试
7-1 打印沙漏 (20 分)本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印所谓“沙漏形状”,是指每行输出奇数个符号;各行符号中心对齐;相邻两行符号数差2;符号数先从大到小顺序递减到1,再从小到大顺序递增;首尾符号数相等。给定任意N个符号,不一定能正好组成一个沙漏。要求打印出的沙漏能用掉尽可能多的符号。输入格式:输入在一行给出1个正整数N(≤10...原创 2019-08-22 16:15:22 · 568 阅读 · 0 评论 -
1009 Product of Polynomials
题目This time, you are supposed to find A×B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the inform...原创 2019-08-29 21:27:30 · 108 阅读 · 0 评论 -
1023 Have Fun with Numbers
题目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 ...原创 2019-08-29 21:57:33 · 236 阅读 · 2 评论 -
1012 The 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 Linear Algrbra), and E - ...原创 2019-09-02 19:26:58 · 284 阅读 · 0 评论