自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(62)
  • 收藏
  • 关注

原创 1013 Battle Over Cities (25 分)

1013 Battle Over Cities (25 分)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 from/toward that city are closed. We must know immediately if we need to repair any other hi.

2022-02-21 17:33:17 70

原创 1064 Complete Binary Search Tree (30 分)

1064 Complete Binary Search Tree (30 分)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 with keys less than the node’s key.The right subtree of a node c.

2022-02-17 02:07:04 113

原创 1079 Total Sales of Supply Chain (25 分)

1079 Total Sales of Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys pro.

2022-02-17 01:40:04 290

原创 1090 Highest Price in Supply Chain (25 分)

1090 Highest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys p.

2022-02-08 17:43:13 70

原创 1094 The Largest Generation (25 分)

1094 The Largest Generation (25 分)A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with the largest population.Input Specification:Each i.

2022-02-08 16:11:13 57

原创 1106 Lowest Price in Supply Chain (25 分)

1106 Lowest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys pr.

2022-02-08 15:06:50 77

原创 1004 Counting Leaves (30 分)

1004 Counting Leaves (30 分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts with a line containing 0<.

2022-02-08 14:17:49 67

原创 1104 Sum of Number Segments (20 分)

1104 Sum of Number Segments (20 分)Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we have 10 segments: (0.1) (0.1, 0.2) (0.1, 0.2, 0.3) (0.1, 0.2, 0.3, 0..

2022-02-08 13:52:04 337

原创 1083 List Grades (25 分)

1083 List Grades (25 分)Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades are in a given interval.Input .

2022-02-07 20:20:20 414

原创 1055 The World‘s Richest (25 分)

1055 The World’s Richest (25 分)Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world’s wealthiest people. Now you are supposed to simulate this job, but concentrate only on the people in a certain range of.

2022-02-07 17:10:52 189

原创 1028 List Sorting (25 分)

1028 List Sorting (25 分)Excel can sort records according to any column. Now you are supposed to imitate this function.Input Specification:Each input file contains one test case. For each case, the first line contains two integers N (≤105) and C, wher.

2022-02-07 16:35:42 469

原创 1062 Talent and Virtue (25 分)

1062 Talent and Virtue (25 分)About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people’s talent and virtue. According to his theory, a man being outstanding in both talent and virtue must be a “sage(圣人)”; .

2022-02-06 18:45:27 128

原创 1015 德才论 (25 分)

1015 德才论 (25 分)宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。”现给出一批考生的德才分数,请根据司马光的理论给出录取排名。输入格式:输入第一行给出 3 个正整数,分别为:N(≤105),即考生总数;L(≥60),为录取最低分数线,即德分和才分均不低于 L 的考生才有资格被考虑录取;H(<100),为优先录取线——德分和才分均不低于此.

2022-02-06 18:43:49 63

原创 1093 Count PAT‘s (25 分)

1093 Count PAT’s (25 分)The string APPAPT contains two PAT’s as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4th, and the 6th characters.Now given any string, you are suppos.

2022-01-30 01:34:00 447

原创 1040 有几个PAT (25 分)

1040 有几个PAT (25 分)字符串 APPAPT 中包含了两个单词 PAT,其中第一个 PAT 是第 2 位§,第 4 位(A),第 6 位(T);第二个 PAT 是第 3 位§,第 4 位(A),第 6 位(T)。现给定字符串,问一共可以形成多少个 PAT?输入格式:输入只有一行,包含一个字符串,长度不超过105,只包含 P、A、T 三种字母。输出格式:在一行中输出给定字符串中包含多少个 PAT。由于结果可能比较大,只输出对 1000000007 取余数的结果。输入样例:AP.

2022-01-30 01:32:50 1068

原创 1023 组个最小数 (20 分)

1023 组个最小数 (20 分)给定数字 0-9 各若干个。你可以以任意顺序排列这些数字,但必须全部使用。目标是使得最后得到的数尽可能小(注意 0 不能做首位)。例如:给定两个 0,两个 1,三个 5,一个 8,我们得到的最小的数就是 10015558。现给定数字,请编写程序输出能够组成的最小的数。输入格式:输入在一行中给出 10 个非负整数,顺序表示我们拥有数字 0、数字 1、……数字 9 的个数。整数间用一个空格分隔。10 个数字的总个数不超过 50,且至少拥有 1 个非 0 的数字。输出.

2022-01-30 00:43:21 460

原创 1020 月饼 (25 分)

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

2022-01-30 00:29:04 310

原创 1025 PAT Ranking (25 分)

1025 PAT Ranking (25 分)Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklists will be merged immediately after.

2022-01-29 22:54:56 120

原创 1082 Read Number in Chinese (25 分)

1082 Read Number in Chinese (25 分)Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output Fu first if it is negative. For example, -123456789 is read as Fu yi Yi er Qian san Bai si Shi wu Wan liu Qi.

2022-01-22 20:41:05 275

原创 1077 Kuchiguse (20 分)

1077 Kuchiguse (20 分)The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker’s personality. Such a preference is called “Kuchiguse” and is often exaggera.

2022-01-22 17:12:17 91

原创 1035 Password (20 分)

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 distinguish 1 (one) from l (L in lowercase), or 0 (zero) from O .

2022-01-22 00:47:14 184

原创 1005 Spell It Right (20 分)

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:Each input file contains one test case. Each case occupies one line which.

2022-01-22 00:23:41 222

原创 1001 A+B Format (20 分)

1001 A+B Format (20 分)Calculate a+b and 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 Specification:Each input file contains one test case. Each c.

2022-01-22 00:14:13 325

原创 1048 数字加密 (20 分)

1048 数字加密 (20 分)本题要求实现一种数字加密方法。首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余——这里用 J 代表 10、Q 代表 11、K 代表 12;对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加 10。这里令个位为第 1 位。输入格式:输入在一行中依次给出 A 和 B,均为不超过 100 位的正整数,其间以空格分隔。输出格式:在一行中输出加密后的结果。输入样.

2022-01-19 20:36:14 36

原创 1073 Scientific Notation (20 分)

1073 Scientific Notation (20 分)Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [±][1-9].[0-9]+E[±][0-9]+ which means that the integer portion has exactly o.

2022-01-19 12:13:52 142

原创 1024 科学计数法 (20 分)

1024 科学计数法 (20 分)科学计数法是科学家用来表示很大或很小的数字的一种方便的方法,其满足正则表达式 [±][1-9].[0-9]+E[±][0-9]+,即数字的整数部分只有 1 位,小数部分至少有 1 位,该数字及其指数部分的正负号即使对正数也必定明确给出。现以科学计数法的格式给出实数 A,请编写程序按普通数字表示法输出 A,并保证所有有效位都被保留。输入格式:每个输入包含 1 个测试用例,即一个以科学计数法表示的实数 A。该数字的存储长度不超过 9999 字节,且其指数的绝对值不超过.

2022-01-19 12:11:58 56

原创 1061 Dating (20 分)

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 those strange strings are actually referring to the coded.

2022-01-18 22:31:24 132

原创 1014 福尔摩斯的约会 (20 分)

1014 福尔摩斯的约会 (20 分)大侦探福尔摩斯接到一张奇怪的字条:我们约会吧!3485djDkxh4hhGE2984akDfkkkkggEdsbs&hgsfdkd&Hyscvnm大侦探很快就明白了,字条上奇怪的乱码实际上就是约会的时间星期四 14:04,因为前面两字符串中第 1 对相同的大写英文字母(大小写有区分)是第 4 个字母 D,代表星期四;第 2 对相同的字符是 E ,那是第 5 个英文字母,代表一天里的第 14 个钟头(于是一天的 0 点到 23 点由数字 0.

2022-01-18 22:29:25 55

原创 1002 写出这个数 (20 分)

1002 写出这个数 (20 分)读入一个正整数 n,计算其各位数字之和,用汉语拼音写出和的每一位数字。输入格式:每个测试输入包含 1 个测试用例,即给出自然数 n 的值。这里保证 n 小于 10100。输出格式:在一行内输出 n 的各位数字之和的每一位,拼音数字间有 1 空格,但一行中最后一个拼音数字后没有空格。输入样例:1234567890987654321123456789输出样例:yi san wu#include<iostream>using namespa.

2022-01-18 00:59:02 352

原创 1031 Check ID card (15 分)

#include<iostream>#include<algorithm>#include<cstdio>using namespace std;int w[17] = { 7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2 };char M[11] = { '1','0','X','9','8','7','6','5','4','3','2' };int main() { int N; int count = 0; cin &gt.

2022-01-18 00:43:56 74

原创 1021 个位数统计 (15 分)

1021 个位数统计 (15 分)给定一个 k 位整数 N=dk−1​10k−1+⋯+d1​101+d0​(0≤di​≤9, i=0,⋯,k−1, dk−1​0),请编写程序统计每种不同的个位数字出现的次数。例如:给定 N=100311,则有 2 个 0,3 个 1,和 1 个 3。输入格式:每个输入包含 1 个测试用例,即一个不超过 1000 位的正整数 N。输出格式:对 N 中每一种不同的个位数字,以 D:M 的格式在一行中输出该位数字 D 及其在 .

2022-01-17 23:52:37 65

原创 1006 换个格式输出整数 (15 分)

1006 换个格式输出整数 (15 分)让我们用字母 B 来表示“百”、字母 S 表示“十”,用 12…n 来表示不为零的个位数字 n(<10),换个格式来输出任一个不超过 3 位的正整数。例如 234 应该被输出为 BBSSS1234,因为它有 2 个“百”、3 个“十”、以及个位的 4。输入格式:每个测试输入包含 1 个测试用例,给出正整数 n(<1000)。输出格式:每个测试用例的输出占一行,用规定的格式输出 n。输入样例 1:234输出样例 1:BBSSS1234输.

2022-01-17 18:30:21 230

原创 1058 A+B in Hogwarts (20 分)

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 and twenty-nine Knuts to a Sickle, it’s easy enough.” You.

2022-01-17 18:16:19 144

原创 1027 Colors in Mars (20 分)

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 are for Red, the middle 2 digits for Green, and the last .

2022-01-17 17:43:25 174

原创 1019 General Palindromic Number (20 分)

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

2022-01-17 16:24:49 56

原创 1037 在霍格沃茨找零钱 (20 分)

#include<iostream>using namespace std;struct { long Galleon; int Sickle; int Knut;}money[3];int main() { scanf("%lld.%d.%d", &money[0].Galleon, &money[0].Sickle, &money[0].Knut); scanf("%lld.%d.%d", &money[1].Galleon, &m.

2022-01-17 15:28:39 140

原创 1031 Hello World for U (20 分)

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 rlowoThat is, the characters must be printed in the original order, st.

2022-01-17 15:06:48 230

原创 1027 打印沙漏 (20 分)

1027 打印沙漏 (20 分)本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印所谓“沙漏形状”,是指每行输出奇数个符号;各行符号中心对齐;相邻两行符号数差2;符号数先从大到小顺序递减到1,再从小到大顺序递增;首尾符号数相等。给定任意N个符号,不一定能正好组成一个沙漏。要求打印出的沙漏能用掉尽可能多的符号。输入格式:输入在一行给出1个正整数N(≤1000)和一个符号,中间以空格分隔。输出格式:首先打印出由给定符号组成的最大的沙漏形状,最后.

2022-01-17 14:11:41 232

原创 1036 Boys vs Girls (25 分)

1036 Boys vs Girls (25 分)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.Input Specification:Each input file contains one test case. Each case contains a .

2022-01-16 21:47:31 87

原创 1006 Sign In and Sign Out (25 分)

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 records of signing in’s and out’s, you are supposed to find .

2022-01-16 21:02:53 49

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除