ACM平时刷题
_好吗_好的
Stay Hungry,Stay Foolish.
展开
-
codeforce---Seat Arrangements
C. Seat Arrangements time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Suppose that you are in a campus and have to go for classes day by da原创 2018-02-01 20:19:52 · 290 阅读 · 0 评论 -
51Nod - 1413 -权势二进制 (思维题)
一个十进制整数被叫做权势二进制,当他的十进制表示的时候只由0或1组成。例如0,1,101,110011都是权势二进制而2,12,900不是。当给定一个n的时候,计算一下最少要多少个权势二进制相加才能得到n。Input 单组测试数据。 第一行给出一个整数n (1Output 输出答案占一行。 Sample Input 9 Sample Output 9因为权势二进制可以原创 2018-02-02 21:57:17 · 732 阅读 · 0 评论 -
了断局
链接:https://www.nowcoder.com/acm/contest/74/H 来源:牛客网既然是了断局了,大家就随便玩玩数字呗。 已知一个数列前10项分别是 {0, 1, 1, 2, 4, 7, 13, 24, 44, 81} 小G不满足呀:我要更多的数!!!不给就不让你们玩了。 小G会问你第n项是什么数字,请回答这个顽皮的孩子吧。输入描述: 多组数据输入输出;原创 2018-01-29 09:34:32 · 686 阅读 · 0 评论 -
送分了QAQ
链接:https://www.nowcoder.com/acm/contest/74/G 来源:牛客网杭州人称傻乎乎的人为62,而嘟嘟家这里没有这样的习俗。相比62,他那里的人更加讨厌数字38,当然啦,还有4这个数字!所以啊,嘟嘟不点都不想见到包含38或者4的数字。每次给出一个区间[n,m],你能找到所有令人讨厌的数字吗?输入描述: 多组输入输出; 输入的都原创 2018-01-29 09:36:21 · 287 阅读 · 0 评论 -
宏定义判断闰年
给年份year,定义一个宏,以判别该年份是否闰年。提示:宏名可以定义为LEAP_YEAR,形参为y,既定义宏的形式为 #define LEAP_YEAR(y) (读者设计的字符串) 输入 一个年份 输出 根据是否闰年输出,是输出”L”,否输出”N” 样例输入 2000 样例输出 L#include <cstdio>#include <algorithm>...原创 2018-02-26 09:32:27 · 3181 阅读 · 0 评论 -
L1-043. 阅览室
L1-043. 阅览室 天梯图书阅览室请你编写一个简单的图书借阅统计程序。当读者借书时,管理员输入书号并按下S键,程序开始计时;当读者还书时,管理员输入书号并按下E键,程序结束计时。书号为不超过1000的正整数。当管理员将0作为书号输入时,表示一天工作结束,你的程序应输出当天的读者借书次数和平均阅读时间。注意:由于线路偶尔会有故障,可能出现不完整的纪录,即只有S没有E,或者只有E没有S的纪录...原创 2018-02-28 15:55:17 · 216 阅读 · 0 评论 -
codeforce --- Perfect Number
B. Perfect Number time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output We consider a positive integer perfect, if and only if the sum of its d原创 2018-02-01 20:18:40 · 244 阅读 · 0 评论 -
codeforce--Supermarket
A. Supermarket time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output We often go to supermarkets to buy some fruits or vegetables, and on the t原创 2018-02-01 20:17:27 · 259 阅读 · 0 评论 -
A + B Problem II
Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.Input The first line of the input contains an integer T(1<=T<=20) which原创 2018-01-23 19:22:15 · 523 阅读 · 0 评论 -
博弈类题目小结(HDU,POJ,ZOJ)
转载请注明出处,谢谢http://blog.csdn.net/ACM_cxlove?viewmode=contents by—cxlove首先当然要献上一些非常好的学习资料: 基础博弈的小结:http://blog.csdn.net/acm_cxlove/article/details/7854530 经典翻硬币游戏小结:http://blog.csdn.net/acm_cxlove/ar原创 2017-09-13 19:48:13 · 275 阅读 · 0 评论 -
HD-6216-A Cubic number and A Cubic Number
Problem Description A 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,64 and 1原创 2017-09-18 20:03:14 · 485 阅读 · 0 评论 -
PAT-1003-我要通过!
“答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于PAT的“答案正确”大派送 —— 只要读入的字符串满足下列条件,系统就输出“答案正确”,否则输出“答案错误”。得到“答案正确”的条件是:字符串中必须仅有P, A, T这三种字符,不可以包含其它字符;任意形如 xPATx 的字符串都可以获得“答案正确”,其中 x 或者是空字符串,或者是仅由字母 A 组成的字符串;如果 aPbTc 是正确的原创 2018-01-02 15:24:05 · 277 阅读 · 0 评论 -
科学计数法算1到30的阶乘和
由于1到30的阶乘和在double范围内,所以用double 代码如下:#include <cstdio>int main(){ double sum=1; double sum1=0; for(int a = 1;a <= 30;a ++ ) { sum=1; for(int b = 1;b <=a ;b ++)原创 2018-01-03 09:56:54 · 5545 阅读 · 2 评论 -
找数字(牛客网)
链接:https://www.nowcoder.com/acm/contest/67/I 来源:牛客网题目描述 lulu喜欢小于等于1000的正整数,但是如果某个数是a或b的倍数,lulu会讨厌这个数。如果某个数里包含了a和b两个数里包含的数,lulu也会讨厌。(例如a=14,b=23,如果数字中包含1、2、3、4这四个数中的任意一个数,lulu就会讨厌这个数)。现在告诉你a,b,你能原创 2018-01-21 19:01:50 · 950 阅读 · 0 评论 -
方块与收纳盒(牛客网)
链接:https://www.nowcoder.com/acm/contest/67/H 来源:牛客网题目描述 现在有一个大小n*1的收纳盒,我们手里有无数个大小为1*1和2*1的小方块,我们需要用这些方块填满收纳盒,请问我们有多少种不同的方法填满这个收纳盒 输入描述: 第一行是样例数T 第2到2+T-1行每行有一个整数n(n<=80),描述每个样例中的n。 输出描述: 对于原创 2018-01-21 19:04:36 · 546 阅读 · 0 评论 -
946B Weird Subtraction Process
You have two variables a and b. Consider the following sequence of actions performed with these variables:If a = 0 or b = 0, end the process. Otherwise, go to step 2; If a ≥ 2·b, then set the value...原创 2018-03-15 15:15:56 · 272 阅读 · 0 评论