
2019湖中大寒假训练(大一)
名字在哪啊
没有简介
展开
-
CSU-1783(聊天止与呵呵)
Description(现代版)俗话说:流言止于智者,聊天止于呵呵。输入一段聊天记录,你的任务是数一数有多少段对话“止于呵呵”,即对话的最后一句话包含单词 hehe 或者它的变形。具体来说,我们首先提取出对话的最后一句话,把所有非字母的字符替换成空格,把所有字符 替换成小写,然后导出一个单词列表(由空格隔开),只要列表中的任何一个单词是 hehe,这 段对话就算作“止于呵呵”。比如,“Hi!...原创 2019-05-19 12:35:33 · 271 阅读 · 0 评论 -
HDU-1009(FatMouse' Trade)
Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.The warehouse has N rooms. The i-th room contain...原创 2019-03-09 16:15:38 · 481 阅读 · 0 评论 -
UVA-156(Ananagrams)
problem descributionMost crossword puzzle fans are used to anagrams — groups of words with the same letters in different orders — for example OPTS, SPOT, STOP, POTS and POST. Some words however do no...原创 2019-03-06 17:59:20 · 433 阅读 · 0 评论 -
HDU-1005(Number Sequence)
题目Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).InputThe inp...原创 2019-03-05 15:55:13 · 2156 阅读 · 3 评论 -
HDU-1236(排名)
Problem Description今天的上机考试虽然有实时的Ranklist,但上面的排名只是根据完成的题数排序,没有考虑每题的分值,所以并不是最后的排名。给定录取分数线,请你写程序找出最后通过分数线的考生,并将他们的成绩按降序打印。Input测试输入包含若干场考试的信息。每场考试信息的第1行给出考生人数N ( 0 < N< 1000 )、考题数M ( 0 < M...原创 2019-03-05 15:44:15 · 406 阅读 · 0 评论 -
HDU-1004(Let the Balloon Rise)
题目Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guessing the most popular problem. When the contest...原创 2019-02-18 17:49:37 · 200 阅读 · 0 评论 -
HDU-1896(Stones)
题目Problem DescriptionBecause of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a little tired, so Sempr always play so...原创 2019-02-18 16:23:17 · 240 阅读 · 0 评论 -
数字三角(简单dp)
代码:#include&amp;amp;lt;cstdio&amp;amp;gt;#include&amp;amp;lt;iostream&amp;amp;gt;using namespace std;int a[105][105],b[105][105],c[105];int main(){&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;原创 2019-01-29 22:32:39 · 233 阅读 · 0 评论 -
二分解法(集合A,B,C是否存在各取一个元素使之等于输入的S值)
#include&amp;lt;cstdio&amp;gt;#include&amp;lt;iostream&amp;gt;#include&amp;lt;algorithm&amp;gt;using namespace std;int a[500],b[500],c[500],d[250010];int main(){ int l,n,m; int s; i原创 2019-01-29 22:35:02 · 236 阅读 · 0 评论 -
二分法(青蛙过河)
2019-1-28青蛙过河(二分法)!题目大意:青蛙过河输入l(河岸距离),n(石头数目),m(允许跳的最多次数)求青蛙最小的跳跃能力(能在允许的步数内跳过可)代码`![#include#include#includeusing namespace std;int stone[500010];//保存石头距离河岸(出发岸)的距离int main(){int l,n,m;//...原创 2019-01-29 22:40:21 · 672 阅读 · 0 评论 -
“骨头收藏家”(袋子问题)(简单dp)
题目:题目大意:一个骨头收藏家,他有一个体积为m的袋子,他去了坟墓,遇到n个骨头,每个骨头的价值和体积不一样,求他能装骨头的最大价值。代码:#include&amp;lt;cstdio&amp;gt;#include&amp;lt;cstring&amp;gt;#include&amp;lt;iostream&amp;gt;#include&amp;lt;algor原创 2019-01-29 23:25:15 · 774 阅读 · 0 评论 -
POJ-1328(Radar Installation)
DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, loca...原创 2019-03-14 13:08:42 · 272 阅读 · 0 评论 -
HDU-4585(Shaolin)
Problem DescriptionShaolin temple is very famous for its Kongfu monks.A lot of young men go to Shaolin temple every year, trying to be a monk there. The master of Shaolin evaluates a young man mainly...原创 2019-03-04 16:49:52 · 528 阅读 · 0 评论 -
HDU-5233(Gunner II)
Problem DescriptionLong long ago, there was a gunner whose name is Jack. He likes to go hunting very much. One day he go to the grove. There are n birds and n trees. The i-th bird stands on the top o...原创 2019-03-04 18:00:16 · 427 阅读 · 0 评论 -
HDU-1789(Doing Homework again)
Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in t...原创 2019-03-12 18:05:39 · 324 阅读 · 0 评论 -
HDU-4004(The Frog's Games)
Problem DescriptionThe annual Games in frogs’ kingdom started again. The most famous game is the Ironfrog Triathlon. One test in the Ironfrog Triathlon is jumping. This project requires...原创 2019-03-17 16:31:21 · 378 阅读 · 0 评论 -
2019湖中大寒假训练题解目录(大一)
Day1-学会CBHDU–2000(ASCII码排序)HDU-2085(核反应堆)HDU-2094(产生冠军)CodeForces-831A(Unimodal Array)CodeForces-337A(Puzzles)Day2-初始C++原创 2019-03-17 11:15:36 · 318 阅读 · 0 评论 -
HDU-2141(Can you find it?)
Problem DescriptionGive you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, Bj, Ck, which satisfy the formula Ai+Bj+Ck...原创 2019-03-16 17:42:59 · 195 阅读 · 0 评论 -
UVA-156(Ananagrams)
DescriptionMost crossword puzzle fans are used to anagrams — groups of words with the same letters in different orders — for example OPTS, SPOT, STOP, POTS and POST. Some words however do not have th...原创 2019-03-16 10:12:47 · 275 阅读 · 0 评论 -
HDU-1896(Stones)
DescriptionBecause of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a little tired, so Sempr always play some games th...原创 2019-03-15 18:23:39 · 311 阅读 · 0 评论 -
CSU-1826(Languages)
DescriptionThe Enterprise has encountered a planet that at one point had been inhabited. The onlyremnant from the prior civilization is a set of texts that was found. Using a small set of keywordsf...原创 2019-03-15 16:23:41 · 241 阅读 · 0 评论 -
HDU-2037(今年暑假不AC)
Problem Description“今年暑假不AC?”“是的。”“那你干什么呢?”“看世界杯呀,笨蛋!”“@#$%^&*%…”确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永远不要忘记关心国家大事)、非常6+7、超级女生,以及王小...原创 2019-03-07 21:53:48 · 295 阅读 · 0 评论 -
CodeForces-893B(Beautiful Divisors)
Problem DescriptionRecently Luba learned about a special kind of numbers that she calls beautiful numbers. The number is called beautiful iff its binary representation consists of k + 1 consecutive o...原创 2019-03-14 23:46:41 · 287 阅读 · 0 评论 -
CSU-1588(合并果子)
Description现在有n堆果子,第i堆有ai个果子。现在要把这些果子合并成一堆,每次合并的代价是两堆果子的总果子数。求合并所有果子的最小代价。Input第一行包含一个整数T(T<=50),表示数据组数。每组数据第一行包含一个整数n(2<=n<=1000),表示果子的堆数。第二行包含n个正整数ai(ai<=100),表示每堆果子的果子数。Output每组数...原创 2019-03-07 13:39:23 · 284 阅读 · 0 评论 -
最大上升子序列(简单dp)
题目:题目大意:输入一串数字,找到其中长度最长的递增子序列。代码:#include &lt;iostream&gt;#include &lt;cstdio&gt;using namespace std;int a[1005],b[1005];//a数组保存序列,b数组保存从起始位置到某元素的最大增序列int main(){&nbsp;&nbsp;&nbs原创 2019-01-29 23:38:44 · 364 阅读 · 0 评论 -
最大子序列(简单dp)
题目:题目大意:输入两个字符串,找到其中相等的子序列。代码:#include &lt;iostream&gt;#include &lt;cstdio&gt;#include &lt;algorithm&gt;#include &lt;sstream&gt;#include &lt;cstring&gt;usin原创 2019-01-29 23:49:29 · 187 阅读 · 0 评论 -
Max Sum(连续序列最大和)(简单dp)
题目:题目大意:找到一串数字中最大连续元素和,并按规定格式输出。代码:#include &lt;iostream&gt;#include &lt;cstdio&gt;using namespace std;int a[1000005];int main(){ int t; int i,j; scanf("%d",&amp;t原创 2019-01-30 00:36:20 · 888 阅读 · 0 评论 -
UVA-11995(I Can Guess the Data Structure!)
题目There is a bag-like data structure, supporting two operations:1 xThrow an element x into the bag.2Take out an element from the bag.Given a sequence of operations with return values, ...原创 2019-02-15 20:24:28 · 214 阅读 · 0 评论 -
codeforces-337A(Puzzles)
题目:PuzzlesThe end of the school year is near and Ms. Manana, the teacher, will soon have to say goodbye to a yet another class. She decided to prepare a goodbye present for her n students and give ea...原创 2019-02-04 11:01:24 · 275 阅读 · 0 评论 -
codeforces-831A(Unimodal Array)
题目:Unimodal ArrayArray of integers is unimodal, if:it is strictly increasing in the beginning;after that it is constant;after that it is strictly decreasing.The first block (increasing) and the l...原创 2019-02-04 10:11:44 · 196 阅读 · 0 评论 -
HDU-2094(产生冠军)
题目:产生冠军Problem Description:有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。球赛的规则如下:如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。根据这个规则,无需循环较量,或许就能确定冠军。你的任务就是面对一群比赛选手,在经...原创 2019-02-04 09:39:42 · 423 阅读 · 0 评论 -
HDU-2085(核反应堆)
题目:核反应堆problem description:某核反应堆有两类事件发生:高能质点碰击核子时,质点被吸收,放出3个高能质点和1个低能质点;低能质点碰击核子时,质点被吸收,放出2个高能质点和1个低能质点。假定开始的时候(0微秒)只有一个高能质点射入核反应堆,每一微秒引起一个事件发生(对于一个事件,当前存在的所有质点都会撞击核子),试确定n微秒时高能质点和低能质点的数目。input:...原创 2019-02-04 09:29:03 · 439 阅读 · 0 评论 -
HDU-2000(ASCII码排序)
题目:ASCII码排序problem description:输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。input:输入数据有多组,每组占一行,有三个字符组成,之间无空格。output:对于每组输入数据,输出一行,字符中间用一个空格分开。Sample Input:asdzxcSample Outpute:a d sc x z题目大意:我都不好意...原创 2019-02-04 09:05:28 · 233 阅读 · 0 评论 -
HDU-2031(进制转换)
题目Problem Description输入一个十进制数N,将它转换成R进制数输出。Input输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(2&amp;lt;=R&amp;lt;=16, R&amp;lt;&amp;gt;10)。Output为每个测试实例输出转换后的数,每个输出占一行。如果R大于10,则对应的数字规则参考16进制(比如,10用A表示,等等)。Sample Input7原创 2019-02-14 18:56:58 · 593 阅读 · 0 评论 -
NBUT-1521(+-字符串)
题目问题描述Shiva得到了两个只有加号和减号的字符串。Shiva一次可以把一个加号和它相邻的减号交换。他想知道最少需要多少次操作才能把第一个字符串变换成第二个字符串。你现在要去帮助他完成那个这个问题。输入输入数据有两行,每行包含一个由”+”和”-“最成的字符串。每个子符串长度不超过5000。输出仅一个整数,输出最少需要操作的次数。如果答案不存在,输出-1。样例输入+±±-+-+...原创 2019-02-10 15:58:02 · 213 阅读 · 0 评论 -
UVA-232 ( Crossword Answers)
题目A crossword puzzle consists of a rectangular grid of black and white squares and two lists of definitions (or descriptions). One list of definitions is for “words” to be written left to right across ...原创 2019-02-10 14:36:16 · 227 阅读 · 0 评论 -
POJ-3096(Surprising Strings)
题目:Surprising StringsDescriptionThe D-pairs of a string of letters are the ordered pairs of letters that are distance D from each other. A string is D-unique if all of its D-pairs are different. A s...原创 2019-02-04 21:48:15 · 754 阅读 · 0 评论 -
HDU-1284(钱币兑换问题)(dp)
题目:原题链接:HDU-1284代码:#include &lt;cstdio&gt;int coin[4][32770];int main(){&nbsp;&nbsp;&nbsp; //coin[i][j]表示j分钱用小于i价值的硬币兑换的方式&nbsp;&nbsp;&nbsp; int n;&nbsp;&nb原创 2019-02-02 21:04:37 · 461 阅读 · 0 评论 -
POJ-1915(Knight Moves)(BFS)
题目:原题链接:POJ-1915题目大意:输入一个数t表示测试样例有t个每个测试样例有三行,第一行n代表棋盘大小为n*n,第二行表示起点的坐标,第三行表示终点坐标每一步都按照国际象棋骑士的走法走,求最少的步数中起点走到终点代码:#include &lt;cstdio&gt;#include&lt;cstring&gt;#include&lt;queue&gt;using原创 2019-02-02 20:57:19 · 440 阅读 · 0 评论 -
HDU-2018(母牛的故事)(递归)(递推)
题目:题目大意:意思比较明显。。。。。。。。。递归代码:#include &amp;lt;cstdio&amp;gt;int num;void cattle(int n){ for(int i=1; i&amp;lt;=n; i++) { if(i&amp;gt;1) num++; cattle(n-i-2); }}int原创 2019-02-02 20:41:27 · 326 阅读 · 0 评论