
水题
追逐星辰的光
脚踏实地,虚心前行
展开
-
HDU 6182 A Math Problem
You are given a positive integer n, please count how many positive integers k satisfy kk≤nkk≤n. InputThere are no more than 50 test cases. Each case only contains a positivse integer n in a原创 2017-10-24 20:12:48 · 408 阅读 · 0 评论 -
nswoj 1201 - 九的余数
题目描述现在给你一个自然数n,它的位数小于等于一百万,现在你要做的就是求出这个数整除九之后的余数。输入第一行有一个整数m(1<=m<=8),表示有m组测试数据;随后m行每行有一个自然数n。输出输出n整除九之后的余数,每次输出占一行。样例输入3 4 5 465456541 样例输出4 5 4 提示来源NYOJ#include<stdio.h> #include<stri...原创 2018-03-10 20:33:07 · 438 阅读 · 0 评论 -
计蒜客2018蓝桥杯省赛B组模拟赛(一)D,E,F题
4. (11')LIS LIS是最长上升子序列。什么是最长上升子序列? 就是给你一个序列,请你在其中求出一段最长严格上升的部分,它不一定要连续。 就像这样:2, 3, 4, 7 和 2, 3, 4, 6 就是序列 2 5 3 4 1 7 6 的两个上升子序列,最长的长度是 4。解析:最长上升子序列问题:dp[i] = max(dp[i], d[j]+1);具体代码如下:...原创 2018-03-08 19:49:30 · 633 阅读 · 0 评论 -
计蒜客2018蓝桥杯省赛B组模拟赛(一)前三题
1. (3')年龄 今天蒜头君带着花椰妹和朋友们一起聚会,当朋友们问起年龄的时候,蒜头君打了一个哑谜(毕竟年龄是女孩子的隐私)说:“我的年龄是花椰妹年龄个位数和十位数之和的二倍”。 花椰妹看大家一脸懵逼,就知道大家也不知道蒜头君的年龄,便连忙补充道:“我的年龄是蒜头君个位数和十位数之和的三倍”。 请你计算:蒜头君和花椰妹年龄一共有多少种可能情况? ...原创 2018-03-08 11:01:47 · 959 阅读 · 0 评论 -
POJ 3122 Pie
My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of原创 2018-01-28 23:23:28 · 294 阅读 · 0 评论 -
POJ - 3617 Best Cow Line
FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges. The contest orga原创 2018-01-07 16:40:56 · 316 阅读 · 0 评论 -
POJ - 1852 Ants
An army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it immediatelly falls off it. When two ants meet they tur原创 2018-01-07 13:27:52 · 238 阅读 · 0 评论 -
UVA 10474 Where is the Marble?
题目链接:https://vjudge.net/problem/UVA-10474 题意:多组数据,第一行,N,Q N代表有N个数,Q代表有Q次询问, 接下来是N个数, 然后是Q个询问,每个询问是一个数,代表这个数在原来的N个数中第几(升序) 用计数排序很容易解决了,计数排序思想很简单,当然其他方法也可以,可以排序STL二分,也能过,水题水解。 #include原创 2018-01-06 21:48:47 · 359 阅读 · 0 评论 -
nyoj 1324 士兵杀敌(五)
提交 题目描述 南将军麾下有百万精兵,现已知共有M个士兵,编号为0~M,每次有任务的时候,总会有一批编号连在一起人请战(编号相近的人经常在一块,相互之间比较熟悉),最终他们获得的军功,也将会平分到每个人身上,这样,有时候,计算他们中的哪一个人到底有多少军功就是一个比较困难的事情。 在这样的情况下,南将军却经常会在许多次战役之后询问军师小工第i号士兵到第j号士兵所有人的总军功原创 2017-12-28 20:06:10 · 271 阅读 · 0 评论 -
UVA 10763 Foreign Exchange
Your non-profit organization (iCORE - international Confederation of Revolver Enthusiasts) coordinates a very successful foreign student exchange program. Over the last few years, demand has sky-roc原创 2018-01-12 10:48:46 · 358 阅读 · 0 评论 -
UVA 10935 Throwing cards away I
题目链接:https://vjudge.net/problem/UVA-10935 题意:桌子上有n(n Sample Input 7 19 10 6 0 Sample Output Discarded cards: 1, 3, 5, 7, 4, 2 Remaining card: 6 Discarded cards: 1, 3, 5, 7, 9, 11, 13, 15, 1原创 2018-01-12 10:01:23 · 313 阅读 · 0 评论 -
UVA 1594 Ducci Sequence
题目链接:https://vjudge.net/problem/UVA-1594 题意:对于一个n元组(a1,a2,a3,...,an),可以对于每个数求出它和下一个数的差的绝对值,得到一个新的n元组(|a1-a2|,|a2-a3|,...,|an-a1|).重复这个过程,得到的序列成为Ducci序列,例如(8, 11, 2, 7) → (3, 9, 5, 1) → (6, 4, 4, 2) →原创 2018-01-11 20:58:49 · 288 阅读 · 0 评论 -
UVA 1593 Alignment of Code
题目链接:https://vjudge.net/problem/UVA-1593 题意:输入若干代码,要求各列单词的左边界对齐并且尽量靠左。单词之间至少要空一行。每个单词不超过80个字符,每行不超过180个字符,一共最多1000行。 样例输入: start: integer; // begins here stop: integer; // ends here s:原创 2018-01-11 17:59:27 · 276 阅读 · 0 评论 -
HDU 2111 Saving HDU
话说上回讲到海东集团面临内外交困,公司的元老也只剩下XHD夫妇二人了。显然,作为多年拼搏的商人,XHD不会坐以待毙的。 一天,当他正在苦思冥想解困良策的时候,突然想到了自己的传家宝,那是公司成立的时候,父亲作为贺礼送来的一个锦囊,徐父当时交代,不到万不得已的时候,不要打开它。“现在不正是最需要的时候吗?”,一边想,XHD一边找到了这个精心保管的锦囊,打开一看,里面只有一句话“杭城北麓千人洞原创 2017-12-26 15:25:10 · 251 阅读 · 0 评论 -
poj 3087 Shuffle'm Up
A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containing C chips.原创 2017-12-31 15:58:29 · 195 阅读 · 0 评论 -
POJ 3126 Prime Path
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of s原创 2017-12-31 14:57:13 · 294 阅读 · 0 评论 -
1426 Find The Multiple
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there原创 2017-12-31 13:54:23 · 259 阅读 · 0 评论 -
H - All in All UVA - 10340
Problem E All in All Input: standard input Output: standard output Time Limit: 2 seconds Memory Limit: 32 MB You have devised a new encryption technique which encodes a message by in原创 2017-10-24 23:14:45 · 216 阅读 · 0 评论 -
BASIC-9 特殊回文数
问题描述 123321是一个非常特殊的数,它从左边读和从右边读是一样的。 输入一个正整数n, 编程求所有这样的五位和六位十进制数,满足各位数字之和等于n 。输入格式 输入一行,包含一个正整数n。输出格式 按从小到大的顺序输出满足条件的整数,每个整数占一行。样例输入52样例输出899998989989998899数据规模和约定 1<=n<=54。解析:打表模拟呗,没想到好的办法...原创 2018-03-12 09:19:58 · 346 阅读 · 0 评论