简单题
文章平均质量分 71
征服所有不服
行走在西子湖畔,我是江南最尊贵的神犇。流浪在CSDN,我是世间最美的情郎。
展开
-
【剑指紫金港】1129 Recommendation System Set妙用
A 1129 Recommendation System题目链接Problem DescriptionRecommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that rates the user’s preference by the number of times原创 2021-02-14 20:40:20 · 75 阅读 · 0 评论 -
【剑指紫金港】1117 Eddington Number 大年初一第一篇!
A 1117 Eddington Number题目链接Problem DescriptionBritish astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an “Eddington number”, E – that is, the maximum integer E such that it is for E days tha原创 2021-02-12 20:22:14 · 77 阅读 · 0 评论 -
【剑指紫金港】1112 Stucked Keyboard
A 1112 Stucked Keyboard题目链接Problem DescriptionOn a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear repeatedly on screen for k times.Now given a resulting stri原创 2021-02-10 22:28:01 · 102 阅读 · 0 评论 -
【剑指紫金港】1110 Complete Binary Tree 完全二叉树静态实现
A 1110 Complete Binary Tree题目链接Problem DescriptionGiven a tree, you are supposed to tell if it is a complete binary tree.InputEach input file contains one test case. For each case, the first line gives a positive integer N (≤20) which is the total num原创 2021-02-10 12:26:05 · 119 阅读 · 0 评论 -
【剑指紫金港】1108 Finding Average(sscanf和sprintf)
A 1108 Finding Average题目链接Problem DescriptionThe basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input numbers might not be legal. A legal input is a real number原创 2021-02-09 22:07:58 · 80 阅读 · 0 评论 -
【剑指紫金港】1086 Tree Traversals Again 已知先序中序求后序
A 1086 Tree Traversals Again题目链接Problem DescriptionAn inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the stack原创 2021-02-07 16:19:18 · 61 阅读 · 0 评论 -
【剑指紫金港】1088 Rational Arithmetic 分数计算
A 1088 Rational Arithmetic题目链接Problem DescriptionFor two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient.InputEach input file contains one test case, which gives in o原创 2021-02-04 23:38:48 · 85 阅读 · 0 评论 -
【剑指紫金港】1064 Complete Binary Search Tree 填空完全二叉搜索树
A 1064 Complete Binary Search Tree题目链接Problem DescriptionA 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原创 2021-02-03 23:42:07 · 94 阅读 · 0 评论 -
【剑指紫金港】1051 Pop Sequence 栈模拟
A 1051 Pop Sequence题目链接Problem DescriptionGiven 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 stack. For原创 2021-02-02 22:36:57 · 102 阅读 · 0 评论 -
【剑指紫金港】1043 Is It a Binary Search Tree 二叉搜索树
题目标题题目链接Problem DescriptionInputOutputSample Input:ASample Output:2题目大意:牛解题思路:龙AC代码#include<bits/stdc++.h>using namespace std;原创 2021-02-01 16:17:45 · 114 阅读 · 0 评论 -
【剑指紫金港】1040 Longest Symmetric String DP回文字符串
A 1040 Longest Symmetric String DP回文字符串题目链接Problem DescriptionGiven a string, you are supposed to output the length of the longest symmetric sub-string. For example, given Is PAT&TAP symmetric?, the longest symmetric sub-string is s PAT&TAP s, h原创 2021-02-01 11:02:58 · 86 阅读 · 0 评论 -
【剑指紫金港】1039 Course List for Student 字符串转int映射
A 1039 Course List for Student题目链接Problem DescriptionZhejiang 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原创 2021-02-01 00:01:04 · 61 阅读 · 0 评论 -
【剑指紫金港】1038 Recover the Smallest Number 玄学
A 1038 Recover the Smallest Number(CMP函数的玄学运用)题目链接Problem DescriptionGiven a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover many numbers such like原创 2021-01-31 23:18:08 · 62 阅读 · 0 评论 -
树状数组 单点更新+区间查询
Input每组测试用例首先一行是2个正整数N和M(N<=100000,M<=10000),其中,N表示士兵的数量,M表示有M个询问。接下来一行是N个正整数,依次表示N位士兵CF的Rating。其中,Rating的取值范围是小于等于5000。最后是M行的询问,每行包含2个正整数a和b,表示要计算从第a个士兵到第b个士兵的Rating之和(1<=a, b<=N)。Output每组数据输出M行,分别表示M个询问对应的Rating之和。Sample Input:5 21500原创 2021-01-14 22:04:33 · 136 阅读 · 0 评论 -
萌数 质因数分解
萌数Problem Description一个数,如果他的素数因子只包括2,3,5,7,则称这个数为萌数,比如,下面这些数就是前20个萌数:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27。现在给你一个萌数,请编程计算它的约数的个数。比如,4是一个萌数,他有3个约数(1,2,4);12也是一个萌数,他有 6 个约数(1,2,3,4,6,12)。Input输入包含多组测试用例。每个测试用例包含一个萌数n,原创 2021-01-07 19:18:01 · 591 阅读 · 0 评论 -
寒冰王座(HDU 1248)完全背包模板
寒冰王座题目链接Problem Description不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前.死亡骑士:“我要买道具!”地精商人:“我们这里有三种道具,血瓶150块一个,魔法药200块一个,无敌药水350块一个.”死亡骑士:“好的,给我一个血瓶.”说完他掏出那张N元的大钞递给地精商人.地精商人:“我忘了提醒你了,我们这里没有找客人钱的习惯的,多的钱我们都当小费收了的,嘿嘿.”死原创 2021-01-06 15:45:51 · 201 阅读 · 0 评论 -
【剑指紫金港】1012 The Best Rank 查找&排序
A 1012 The Best Rank题目链接Problem DescriptionTo 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- English. At the原创 2021-01-03 23:41:33 · 115 阅读 · 0 评论