自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 1096 Consecutive Factors (20分)

Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, and 7 are the three consecutive numbers. Now given ...

2020-03-26 16:08:37 91

原创 1049 Counting Ones (30分)

The task is simple: given any positive integer N, you are supposed to count the total number of 1’s in the decimal form of the integers from 1 to N. For example, given N being 12, there are five 1’s i...

2020-03-23 15:22:45 129

原创 第十届蓝桥杯省赛C/C++A组——试题 G: 外卖店优先级

试题 G: 外卖店优先级补充一点:现在的代码是我比赛时写的代码,因为比赛时没有测试,所以只能先拿出来分享给大家,思路应该是对的,但对于能否通过所有的测试点我还不敢保证。问题描述“饱了么”外卖系统中维护着 N 家外卖店,编号 1 ∼ N。每家外卖店都有一个优先级,初始时 (0 时刻) 优先级都为 0。每经过 1 个时间单位,如果外卖店没有订单,则优先级会减少 1,最低减到 0;而如果外卖店有订单,则优先级不减反加,每有一单优先级加 2。如果某家外卖店某时刻优先级大于 5,则会被系统加入优先缓存中;如

2021-01-17 14:41:33 282

原创 1107 Social Clusters (30分)

When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A social cluster is a set of people who have some of thei...

2020-05-06 20:30:25 130

原创 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...

2020-04-27 21:19:18 108

原创 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...

2020-04-27 21:12:47 147

原创 2018-3-2 碰撞的小球

问题描述  数轴上有一条长度为L(L为偶数)的线段,左端点在原点,右端点在坐标L处。有n个不计体积的小球在线段上,开始时所有的小球都处在偶数坐标上,速度方向向右,速度大小为1单位长度每秒。  当小球到达线段的端点(左端点或右端点)的时候,会立即向相反的方向移动,速度大小仍然为原来大小。  当两个小球撞到一起的时候,两个小球会分别向与自己原来移动的方向相反的方向,以原来的速度大小继续移动。 ...

2020-04-26 14:45:39 121

原创 1053 Path of Equal Weight (30分)

Given a non-empty tree with root R, and with weight W​i​​ assigned to each tree node T​i​​. The weight of a path from R to L is defined to be the sum of the weights of all the nodes along the path fro...

2020-04-26 09:25:28 113

原创 2016-4-1 折点计数

问题描述  给定n个整数表示一个商店连续n天的销售量。如果某天之前销售量在增长,而后一天销售量减少,则称这一天为折点,反过来如果之前销售量减少而后一天销售量增长,也称这一天为折点。其他的天都不是折点。如下图中,第3天和第6天是折点。给定n个整数a1, a2, …, an表示销售量,请计算出这些天总共有多少个折点。  为了减少歧义,我们给定的数据保证:在这n天中相邻两天的销售量总是不同的,即a...

2020-04-25 11:49:22 94

原创 1102 Invert a Binary Tree (25分)

The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.Now it’s your turn to pro...

2020-04-25 11:30:48 116

原创 2016-9-1 最大波动

问题描述  小明正在利用股票的波动程度来研究股票。小明拿到了一只股票每天收盘时的价格,他想知道,这只股票连续几天的最大波动值是多少,即在这几天中某天收盘价格与前一天收盘价格之差的绝对值最大是多少。输入格式  输入的第一行包含了一个整数n,表示小明拿到的收盘价格的连续天数。  第二行包含n个正整数,依次表示每天的收盘价格。输出格式  输出一个整数,表示这只股票这n天中的最大波动值。样例...

2020-04-24 12:02:09 92

原创 201612-2工资计算

问题描述  小明的公司每个月给小明发工资,而小明拿到的工资为交完个人所得税之后的工资。假设他一个月的税前工资(扣除五险一金后、未扣税前的工资)为S元,则他应交的个人所得税按如下公式计算:  1) 个人所得税起征点为3500元,若S不超过3500,则不交税,3500元以上的部分才计算个人所得税,令A=S-3500元;  2) A中不超过1500元的部分,税率3%;  3) A中超过1500元...

2020-04-23 12:24:37 129

原创 201612-1 中间数

问题描述  在一个整数序列a1, a2, …, an中,如果存在某个数,大于它的整数数量等于小于它的整数数量,则称其为中间数。在一个序列中,可能存在多个下标不相同的中间数,这些中间数的值是相同的。  给定一个整数序列,请找出这个整数序列的中间数的值。输入格式  输入的第一行包含了一个整数n,表示整数序列中数的个数。  第二行包含n个正整数,依次表示a1, a2, …, an。输出格式...

2020-04-23 11:52:51 129

原创 1091 Acute Stroke (30分)

One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job is to c...

2020-04-17 20:23:43 98

原创 1103 Integer Factorization (30分)

The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the K−P factorization of N for any positive...

2020-04-14 17:47:52 114

原创 1074 Reversing Linked List (25分)

Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K=3, then you must output 3→2→1→6→5→4; if K=4,...

2020-04-11 18:12:38 159

原创 1052 Linked List Sorting (25分)

A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key and a Next pointer to the next structure. Now give...

2020-04-09 21:16:57 106

原创 2019-12-2 回收站选址

思路:起初想用多重map做题,但之前也一直没有了解过,就只好使用pair来解题题目逻辑还是很明确的,重点是map的使用以及pair的使用,只要清楚直到,解题还是很简单的AC#include<stdio.h>#include<map>using namespace std;map<pair<int,int>,int>mp;//pair的用法...

2020-04-08 21:36:15 99

原创 1056 Mice and Rice (25分)

Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much rice...

2020-04-07 19:15:57 128

原创 1051 Pop Sequence (25分)

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 tell if a given sequence of numbers is a possible pop sequence of the...

2020-04-06 21:33:57 402

原创 2019-3-2 二十四点

题意:在不大于10以内的加减乘除运算,看他们是否等于24思路:这道题主要需要注意的是运算符优先级的考虑,这里我们使用map<char,int>来体现运算符的优先级;而算数运算则通过中缀表达式转换后缀表达式,利用栈和对列来进行操作;stack用来存储操作符:如果当前操作符比栈顶操作法优先级高,则将它压入栈中,若果小于等于栈顶操作符优先级,则将栈顶的操作符压入队列中queue用来存储...

2020-04-06 11:29:47 131

原创 1022 Digital Library (30分)

A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number a...

2020-04-01 16:49:20 78

原创 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...

2020-04-01 11:39:47 151

原创 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 proportional area is called the d...

2020-04-01 11:32:30 86

原创 201712-2 游戏

问题描述  有n个小朋友围成一圈玩游戏,小朋友从1至n编号,2号小朋友坐在1号小朋友的顺时针方向,3号小朋友坐在2号小朋友的顺时针方向,……,1号小朋友坐在n号小朋友的顺时针方向。  游戏开始,从1号小朋友开始顺时针报数,接下来每个小朋友的报数是上一个小朋友报的数加1。若一个小朋友报的数为k的倍数或其末位数(即数的个位)为k,则该小朋友被淘汰出局,不再参加以后的报数。当游戏中只剩下一个小朋友时...

2020-03-31 11:10:04 112

原创 201703-2 学生排队

问题描述  体育老师小明要将自己班上的学生按顺序排队。他首先让学生按学号从小到大的顺序排成一排,学号小的排在前面,然后进行多次调整。一次调整小明可能让一位同学出队,向前或者向后移动一段距离后再插入队列。  例如,下面给出了一组移动的例子,例子中学生的人数为8人。  0)初始队列中学生的学号依次为1, 2, 3, 4, 5, 6, 7, 8;  1)第一次调整,命令为“3号同学向后移动2”,...

2020-03-30 10:29:12 266

原创 1063 Set Similarity (25分)

Given two sets of integers, the similarity of the sets is defined to be N​c​​/N​t​​×100%, where N​c​​ is the number of distinct common numbers shared by the two sets, and N​t​​ is the total number of ...

2020-03-30 09:38:04 84

原创 1039 Course List for Student (25分)

Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes ...

2020-03-29 17:48:56 89

原创 1023 Have Fun with Numbers (20分)

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 con...

2020-03-27 18:15:36 74

原创 1024 Palindromic Number (25分)

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...

2020-03-27 17:47:14 155

原创 1059 Prime Factors (25分)

Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p​1​​​k​1​​​​×p​2​​​k​2​​​​×⋯×p​m​​​k​m​​​​.Input Specification:Each input file cont...

2020-03-26 15:37:25 113

原创 1078 Hashing (25分)

The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to be H(key)=key%TSiz...

2020-03-25 16:55:17 162

原创 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 because its reverse 37 is also a pr...

2020-03-25 15:53:58 55

原创 1013 数素数 (20分)

令 P​i​​ 表示第 i 个素数。现任给两个正整数 M≤N≤10​4​​,请输出 P​M​​ 到 P​N​​ 的所有素数。输入格式:输入在一行中给出 M 和 N,其间以空格分隔。输出格式:输出从 P​M​​ 到 P​N​​ 的所有素数,每 10 个数字占 1 行,其间以空格分隔,但行末不得有多余空格。输入样例:5 27输出样例:11 13 17 19 23 29 31 37 41...

2020-03-25 11:17:40 206

原创 1088 Rational Arithmetic (20分)

For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient.Input Specification:Each input file contains one test cas...

2020-03-24 21:02:24 68

原创 1081 Rational Sum (20分)

Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum.Input Specification:Each input file contains one test case. Each case starts with a positive integ...

2020-03-24 16:20:22 158

原创 1008 Elevator (20分)

1008 Elevator (20分)The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop...

2020-03-23 14:18:24 244

原创 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 segment...

2020-03-23 13:11:18 145

原创 1069 The Black Hole of Numbers (20分)

**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-...

2020-03-23 12:45:30 471

空空如也

空空如也

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

TA关注的人

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