随笔分类 -  寒假比赛

摘要:题意:给出两组数字,第二组数字代表第一组数字中的第几位。求从那一位开始,后面不同的数的个数DescriptionSereja has an arraya, consisting ofnintegersa1,a2,...,an. The boy cannot sit and do nothing, h... 阅读全文
posted @ 2015-02-12 19:50 江豚 阅读(177) 评论(0) 推荐(0)
摘要:题意:ekjfkj=output 依此解开密码,得到题意求第n位(本身是素数,同时反过来也是素数的数)题解:打表注意:数组开大,反过来的数不能是自己本身Descriptionqd ucyhf yi q fhycu dkcruh mxeiu huluhiu yi q tyvvuhudj fhycu d... 阅读全文
posted @ 2015-02-12 19:46 江豚 阅读(186) 评论(0) 推荐(0)
摘要:题意:给出一组数字,得到区间[1,a1],[a1+1,a1+a2],[a1+a2+1,a1+a2+a3].....再给出一组数字,求这些数字属于第几个区间注意:记得数组开大,容易超时DescriptionIt is lunch time for Mole. His friend, Marmot, p... 阅读全文
posted @ 2015-02-12 19:40 江豚 阅读(158) 评论(0) 推荐(0)
摘要:题解:类似于最大上升子序列Iahub got bored, so he invented a game to be played on paper.He writesnintegersa1, a2, ..., an. Each of those integers can be either 0 or... 阅读全文
posted @ 2015-02-10 18:50 江豚 阅读(174) 评论(0) 推荐(0)
摘要:题意:给位数和位数和 求符合要求的最大值和最小值//想法都有了,可是却没有做粗来(你484傻啊⁽⁽ ◟(눈_눈)◞ ⁾⁾)DescriptionYou have a positive integermand a non-negative integers. Your task is to find ... 阅读全文
posted @ 2015-02-10 18:47 江豚 阅读(127) 评论(0) 推荐(0)
摘要:题意:统计字母的个数,以“*”号输出 1 #include 2 #include 3 #include 4 int main() 5 { 6 char str[4][100]; 7 char map[100][100]; 8 int i,j; 9 int a[100]... 阅读全文
posted @ 2015-02-09 22:26 江豚 阅读(129) 评论(0) 推荐(0)
摘要:题意:判断两点是否在线段的同一方,点不能在线上。题解:模拟一下DescriptionA determined army on a certain border decided to enumerate the coordinates in its patrol in a way to make it... 阅读全文
posted @ 2015-02-09 22:02 江豚 阅读(130) 评论(0) 推荐(0)
摘要:题意:#转/*玩一个游戏,每轮有一个人得分,或减分,当所有轮完成后,找出分数最高的那个人,如果是多个人,找出那些人中第一个达到最高分或更高的人。先保存好每个人的分数,记录下究竟有那几个人会得奖,再次遍历所有回合,找出第一个高于等于那个分数的且最终会得奖的人。*/Sample InputInput3m... 阅读全文
posted @ 2015-02-09 15:15 江豚 阅读(117) 评论(0) 推荐(0)
摘要:题意:一段数字,逆置其中两个使其递增DescriptionBeing a programmer, you like arrays a lot. For your birthday, your friends have given you an array a consisting of ndisti... 阅读全文
posted @ 2015-02-09 09:20 江豚 阅读(172) 评论(0) 推荐(0)
摘要:题意及题解:判断有存在几个后面的数比前面的小;如果没有则输出0;如果有不止一个,则输出-1;如果恰有一个, 那么就需要判断a[1]和a[n]的大小关系。DescriptionOne day, Twilight Sparkle is interested in how to sort a sequen... 阅读全文
posted @ 2015-02-08 21:13 江豚 阅读(180) 评论(0) 推荐(0)
摘要:题意:给n 求最小的x题解:二元一次方程求解,x*x+x*b-n=0 遍历bDescriptionLet's consider equation:x^2 + s(x)·x - n = 0, where x, n are positive integers, s(x) is the function,... 阅读全文
posted @ 2015-02-08 21:07 江豚 阅读(192) 评论(0) 推荐(0)
摘要:题意:求平均值,注意精度A number of students are members of a club that travels annually to exotic locations. Their destinations in the past have included Indiana... 阅读全文
posted @ 2015-02-08 21:01 江豚 阅读(125) 评论(0) 推荐(0)
摘要:题意:求平均每千米花的时间,注意精度和格式DescriptionA relay is a race for two or more teams of runners. Each member of a team runs one section of the race. Your task is t... 阅读全文
posted @ 2015-02-08 20:58 江豚 阅读(206) 评论(0) 推荐(0)
摘要:题解:dpDescriptionAlex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game a... 阅读全文
posted @ 2015-02-03 20:53 江豚 阅读(154) 评论(0) 推荐(0)
摘要:题意 :求期望题解 :找规律,列举几个,然后找到规律。坑点:要简化,不简化数字一大就wa了Sample InputInput6 1Output3.500000000000Input6 3Output4.958333333333Input2 2Output1.750000000000HintConsi... 阅读全文
posted @ 2015-02-03 20:25 江豚 阅读(113) 评论(0) 推荐(0)
摘要:题意:Sample Input4 6 4 3 2 2 1 15 3 2 1 1400 12 50 50 50 50 50 50 25 25 25 25 25 250 0 Sample OutputSums of 4:43+12+22+1+1Sums of 5:NONESums of 400:50+5... 阅读全文
posted @ 2015-02-03 11:10 江豚 阅读(131) 评论(0) 推荐(0)
摘要:题意 求集合的个数题解 并查集Problem DescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tabl... 阅读全文
posted @ 2015-02-02 10:32 江豚 阅读(140) 评论(0) 推荐(0)
摘要:题意:就是几台电脑,知道他们的坐标,两台修好的电脑如果距离 2 3 #include 4 5 #include 6 7 using namespace std; 8 9 10 11 #define n 1010 12 13 14 15 int pre[n],x[n]... 阅读全文
posted @ 2015-02-02 10:24 江豚 阅读(332) 评论(0) 推荐(0)
摘要://好像读错题了,而且各种坑爹的错误-。-以前的代码,忘记这题目在讲什么了DescriptionPashmak decided to give Parmida a pair of flowers from the garden. There are n flowers in the garden a... 阅读全文
posted @ 2015-02-02 10:21 江豚 阅读(168) 评论(0) 推荐(0)
摘要:///分苹果给两个人 判断是否能够平分 苹果不能切,存在200g和100g的苹果我每次想这种题目都会绕很远 so sad cf上的题目果然每次都让我很暴躁啊DescriptionKitahara Haruki has bought n apples for Touma Kazusa and Ogis... 阅读全文
posted @ 2015-02-02 10:19 江豚 阅读(145) 评论(0) 推荐(0)