数学 思维题
文章平均质量分 63
潮起汐落
这个作者很懒,什么都没留下…
展开
-
杭电5742 之 It's All In The Mind
Problem DescriptionProfessor Zhang has a number sequence a1,a2,...,an. However, the sequence is not complete and some elements are missing. Fortunately, Professor Zhang remembers some properties原创 2016-07-22 15:28:17 · 539 阅读 · 0 评论 -
杭电2072 杭电2073 单词数 无限的路
Problem Descriptionlily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。Input有多组数据,每组一行,每组就是一篇小文章。每篇小文章都是由小写字母和空格组成,没有标点符号,遇到#时表示输入结束。Output每组只输出一个整数,其单独成行,原创 2017-03-05 13:14:58 · 696 阅读 · 0 评论 -
杭电2000到2099一百题的代码
打开杭电acm第11页http://acm.hdu.edu.cn/listproblem.php?vol=11登录账号031540102密码123456原创 2017-03-09 21:29:40 · 1383 阅读 · 0 评论 -
FZU1055之赋值问题
Problem Description在很多程序设计语言中,忘记给变量赋初值的错误常令人头疼。请编程求出含N(0≤N≤100)行的程序段运行以后有哪些变量中有确定的值。在下面的问题中,最开始仅有变量a中有确定的值。变量为单个小写字母,每行恰好有三个字符,中间一个是赋值运算符'='。 Input输入有多组数据,每组数据的第一行有一个整数N,表示程序段的行数。以下N行,每行3个原创 2017-03-30 17:22:08 · 570 阅读 · 0 评论 -
FZU1922(思维题) 之 非主流
Problem 1922 非主流 Accept: 264 Submit: 803Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description非主流指不属于主流的事物,如文化上的次文化,宗教上的异端,人群中的异类等。非主流是相对于主流而存在概念。一个事物既可以从非主流变成主流,也可以从主流变原创 2017-05-10 21:58:36 · 329 阅读 · 0 评论 -
湖北民族学院oj1803 之 计算面积
题目描述小明家刚买了一块地,但是他不知道这块地的面积,因为这块地是由一条抛物线和一条直线围成的。下面的图片展示了这块地的形状。现在给你抛物线的顶点坐标和抛物线与直线的交点坐标,请你计算这块地的面积。输入描述输入的第一行是一个整数t,表示有t组测试数据。每组输入包含三行,第一行输入P1点的坐标,第二行输入P2点的坐标,第三行输入P3点的坐标。每个点的坐标由原创 2017-06-06 11:55:03 · 841 阅读 · 0 评论 -
FZU1057 之 a^b
Problem Description对于任意两个正整数a,b(0b各位数字的和的各位数字的和的各位数字的和的各位数字的和。 Input输入有多组数据,每组只有一行,包含两个正整数a,b。最后一组a=0,b=0表示输入结束,不需要处理。 Output对于每组输入数据,输出ab各位数字的和的各位数字的和的各位数字的和的各位数字的和。 Sample Input2 3原创 2017-06-02 16:54:24 · 385 阅读 · 0 评论 -
杭电 Add More Zero
Problem DescriptionThere is a youngster known for amateur propositions concerning several mathematical hard problems.Nowadays, he is preparing a thought-provoking problem on a specific type of s原创 2017-07-25 13:35:01 · 1247 阅读 · 0 评论 -
杭电 KazaQ's Socks
Problem DescriptionKazaQ wears socks everyday.At the beginning, he has n pairs of socks numbered from 1 to n in his closets. Every morning, he puts on a pair of socks which has the sma原创 2017-07-25 13:36:24 · 984 阅读 · 0 评论 -
杭电 Euler theorem
Problem DescriptionHazelFan is given two positive integers a,b, and he wants to calculate amodb. But now he forgets the value of b and only remember the value of a, please tell him the num原创 2017-08-15 15:28:06 · 423 阅读 · 0 评论 -
杭电 Kolakoski
Problem DescriptionThis is Kolakosiki sequence: 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1……. This sequence consists of 1 and 2, and its first term equals 1. Besides, if you see adjacent and原创 2017-08-15 15:32:04 · 2622 阅读 · 0 评论 -
codeforces 839b 之 Game of the Rows
B. Game of the Rowstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDaenerys Targaryen has an army consistin原创 2017-09-23 21:35:26 · 368 阅读 · 0 评论 -
杭电6216 (打表+二分)之 A Cubic number and A Cubic Number
Problem DescriptionA cubic number is the result of using a whole number in a multiplication three times. For example,3×3×3=27 so 27 is a cubic number. The first few cubic numbers are 1,8,27,原创 2017-09-18 14:19:25 · 511 阅读 · 0 评论 -
codeforces 835b 之 The number on the board
The number on the boardtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSome natural number was written on原创 2017-09-28 15:13:18 · 423 阅读 · 0 评论 -
codeforces 863B 之 Kayaking
Kayakingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVadim is really keen on travelling. Recently he he原创 2017-10-12 20:29:28 · 1437 阅读 · 0 评论 -
排序
题目描述有一个N个数的数组,想要将数组从小到大排好序,但是只允许下面这个操作:任取数组中的一个数然后将它放置在数组的最后一个位置。求最少操作多少次可以使得数组从小到大有序。输入描述一共有T组测试数据。第一行输入一个整数T(T<=100),表示测试数据的组数。每组测试数据第一行输入一个正整数N,第二行输入N个整数。(N <= 50, 每个数的绝对值小于等于1000)输出...原创 2018-07-19 17:17:42 · 915 阅读 · 0 评论 -
数字游戏2
题目描述给定一个任意大小的非负整数N,求出1~N的整数中1出现的次数例如1~13中1出现了6次(1,10,11,12,13)。输入描述一共有T组测试数据。第一行输入一个T,代表T组测试数据。接来下为T行,每行输入一个整数N,1<N<=100000000。输出描述输出为T行,每行对于对应的N,输出1到N中1出现的总个数。输入样例21320输出...原创 2018-07-19 17:19:18 · 857 阅读 · 1 评论 -
FZU1062 之 洗牌问题(打表找规律)
设2n张牌分别标记为1, 2, ..., n, n+1, ..., 2n,初始时这2n张牌按其标号从小到大排列。经一次洗牌后,原来的排列顺序变成n+1, 1, n+2, 2, ..., 2n, n。即前n张牌被放到偶数位置2, 4, ..., 2n,而后n张牌被放到奇数位置1, 3, ..., 2n-1。可以证明对于任何一个自然数n,经过若干次洗牌后可恢复初始状态。现在你的的任务是计算对于给定的n原创 2016-12-31 14:56:54 · 1221 阅读 · 0 评论 -
c/c++编程题 之 猴子选大王(数组、链表两种方法)
题目描述一群猴子要选新猴王。新猴王的选择方法是:让N只候选猴子围成一圈,从某位置起顺序编号为1-N号。从第1号开始报数,每轮从1报到3,凡报到3的猴子即退出圈子,接着又从紧邻的下一只猴子开始同样的报数。如此不断循环,最后剩下的一只猴子就选为猴王。请问是原来第几号猴子当选猴王?输入输入在一行中给一个正整数N(输出在一行中原创 2016-07-21 10:45:32 · 12544 阅读 · 6 评论 -
CodeForces 633A之Ebony and Ivory
DescriptionDante is engaged in a fight with "The Savior". Before he can fight it with his sword, he needs to break its shields. He has two guns, Ebony and Ivory, each of them is able to perform an原创 2016-07-23 15:17:42 · 397 阅读 · 0 评论 -
杭电5640之King's Cake
Problem DescriptionIt is the king's birthday before the military parade . The ministers prepared a rectangle cake of sizen×m(1≤n,m≤10000) . The king plans to cut the cake himself. But he has a s原创 2016-07-23 15:27:45 · 420 阅读 · 0 评论 -
杭电5645之DZY Loves Balls
Problem DescriptionDZY loves playing balls.He has n balls in a big box. On each ball there is an integer written.One day he decides to pick two balls from the box. First he randomly picks原创 2016-07-23 14:49:48 · 764 阅读 · 0 评论 -
模拟题 c/c++ 换酒喝问题
问题描述:来来来,一起做个题,防老年痴呆!啤酒2元一瓶,4个瓶盖可换一瓶啤酒,2个空瓶可换一瓶,问:n元可喝多少瓶酒?(提示:不考虑借酒)简单模拟题,不过所用算法的思想很重要!!!代码如下:#include"iostream"using namespace std;int main(int argc, char* argv[]){原创 2016-06-17 11:37:57 · 1564 阅读 · 0 评论 -
杭电2563之统计问题
Problem Description在一无限大的二维平面中,我们做如下假设:1、 每次只能移动一格;2、 不能向后走(假设你的目的地是“向上”,那么你可以向左走,可以向右走,也可以向上走,但是不可以向下走);3、 走过的格子立即塌陷无法再走第二次;求走n步不同的方案数(2种走法只要有一步不一样,即被认为是不同的方案)。 Input首先给出一个正整原创 2016-06-18 18:12:36 · 573 阅读 · 0 评论 -
杭电5753之Permutation Bo
Problem DescriptionThere are two sequences h1∼hn and c1∼cn.h1∼hn is a permutation of 1∼n. particularly, h0=hn+1=0.We define the expression [condition] is 1 when condition is True,i原创 2016-07-26 17:11:20 · 416 阅读 · 0 评论 -
杭电5752之Sqrt Bo
Problem DescriptionLet's define the function f(n)=⌊n−√⌋.Bo wanted to know the minimum number y which satisfies fy(n)=1.note:f1(n)=f(n),fy(n)=f(fy−1(n))It is a pity that Bo can only u原创 2016-07-26 17:04:52 · 467 阅读 · 0 评论 -
杭电2524 矩形A + B
Problem Description给你一个高为n ,宽为m列的网格,计算出这个网格中有多少个矩形,下图为高为2,宽为4的网格. Input第一行输入一个t, 表示有t组数据,然后每行输入n,m,分别表示网格的高和宽 ( n Output每行输出网格中有多少个矩形. Sample Input21 22 4 Sa原创 2016-06-15 14:14:00 · 447 阅读 · 0 评论 -
杭电2099-整除的尾数
Problem Description一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢? Input输入数据有若干组,每组数据包含二个整数a,b(0 Output对应每组数据,将满足条件的所有尾数在一行内输出,格式见样本输出。同组数据的输出,其每个尾数之间空一格,行末没有空格。 Sample Input20原创 2016-06-15 13:50:47 · 473 阅读 · 0 评论 -
杭电2053S之Switch Game
Problem DescriptionThere are many lamps in a line. All of them are off at first. A series of operations are carried out on these lamps. On the i-th operation, the lamps whose numbers are the multipl原创 2016-06-19 11:55:47 · 619 阅读 · 0 评论 -
杭电5762之Teacher Bo
Problem DescriptionTeacher BoBo is a geography teacher in the school.One day in his class,he markedN points in the map,the i-th point is at (Xi,Yi).He wonders,whether there is a tetrad (A,B,原创 2016-07-27 12:09:58 · 489 阅读 · 0 评论 -
杭电5744之Keep On Movin
Problem DescriptionProfessor Zhang has kinds of characters and the quantity of thei-th character is ai. Professor Zhang wants to use all the characters build several palindromic strings. He al原创 2016-07-21 17:37:09 · 1307 阅读 · 0 评论 -
我叫叶良辰
题目描述细菌(英文:germs;学名:bacteria)广义的细菌即为原核生物是指一大类细胞核无核膜包裹,只存在称作拟核区(nuclear region)(或拟核)的裸露DNA的原始单细胞生物.人们通常所说的即为狭义的细菌,狭义的细菌为原核微生物的一类,是一类形状细短,结构简单,多以二分裂方式进行繁殖的原核生物,是在自然界分布最广和个体数量最多的有机体,是大自然物质循环的主要参与者原创 2016-06-22 15:49:37 · 509 阅读 · 0 评论 -
杭电2084之数塔
Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗? Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1原创 2016-07-30 15:12:29 · 438 阅读 · 0 评论 -
c语言/c++编程题 之 Absolute Value
题目描述God Wang, who may good at math, want to make a research on the absolute value. As a god, he want to build something hard to show his great intelligence.One day, he meets an array with n in原创 2016-08-08 16:58:29 · 895 阅读 · 0 评论 -
杭电5835之Danganronpa
Problem DescriptionChisa Yukizome works as a teacher in the school. She prepares many gifts, which consist ofn kinds with a[i] quantities of each kind, for her students and wants to hold a cla原创 2016-08-14 17:09:56 · 784 阅读 · 0 评论