题意:给定两个队伍的每个人的得分,让你安排怎么比赛才能使得观众知道冠军的时间最长. 析:贪心,很简单,就是先开始总分高的先出最差劲的,总分低的先出最厉害的,这个题当时实在是读的不明白啊,WA了好多次. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include…
2021. Scarily interesting! Time limit: 1.0 secondMemory limit: 64 MB This year at Monsters University it is decided to arrange Scare Games. At the Games all campus gathers at the stadium stands, and the Scare program students divide into two teams to…
Scarily interesting! 题目链接: http://acm.hust.edu.cn/vjudge/contest/126546#problem/D Description This year at Monsters University it is decided to arrange Scare Games. At the Games all campus gathers at the stadium stands, and the Scare program students…
This year at Monsters University it is decided to arrange Scare Games. At the Games all campus gathers at the stadium stands, and the Scare program students divide into two teams to compete in their abilities of scaring children. This year the two te…
Problem This year at Monsters University it is decided to arrange Scare Games. At the Games all campus gathers at the stadium stands, and the Scare program students divide into two teams to compete in their abilities of scaring children. This year th…
Illegal spices 题目连接: http://acm.timus.ru/problem.aspx?space=1&num=1995 Description Jabba: Han, my boy, you disappoint me. Why haven't you paid me? And why did you fry poor Greedo? Han: Look, Jabba, next time you wanna talk to me, come see me yourself…
链接: http://acm.timus.ru/problem.aspx?space=1&num=1303 按照贪心的思想,每次找到覆盖要求区间左端点时,右端点最大的线段,然后把要求覆盖的区间改为这个右端点到M这个区间.依次类推下去,这样的话就只需要扫一遍就可以找去来. 要做的预备工作就是将线段按照左端点的升序排序就可以了. 它的时间复杂度就是O(n) 代码一直WA,望大神指教 #include<iostream> #include<stdio.h> #include<…
题意:有 n 位选手参加编程比赛.比赛有3道题目,每个选手的每道题目都有一个评测之前的预得分(这个分数和选手提交程序的时间相关,提交的越早,预得分越大). 接下来 是系统评测.如果某道题未通过测试,则改题的实际得分为0分,否则得分等于预得分.得分相同的选手,ID小的排在前面. 问是否能给出所有3n个得分以及最后的实际名次.如果可能,输出最后一名的最高可能得分.每个预得分均为小于1000的非负实数,最多保留两位小数. 析:首先这个题是一个水题,一点也不难,我就卡在题意上了,卡了一下午,吃饭回来又读…
http://acm.timus.ru/problem.aspx?space=1&num=2070 题意:A认为如果某个数为质数的话,该数字是有趣的.B认为如果某个数它分解得到的因子数目是素数的话,那么该数字是有趣的. 现在问[L,R]里面有多少个数是同时满足这两个条件或者同时不满足这两个条件的数. 简化题意就是,用[L,R]里面的总数 - 是一个合数并且其因子数是素数的数目. 一开始想,如果是平方的话,那么因子数必定是一个奇数,但是奇数里面的素数要怎么找就不知道了.想到后面离正解越走越远. 正…
最近做的一场比赛,把自己负责过的题目记一下好了. Problem B URAL 2013 Neither shaken nor stirred 题意:一个有向图,每个结点一个非负值,可以转移到其他结点.初始时刻从结点出发,然后每次到达一个结点询问上一个到达的正值结点的权值,离开结点时也要询问一下,因为当前结点可能为正数,答案就是这个值了,如果不存在这个样的正权值输出“sober",或者不明确时输出“unkonwn”. 分析:可以当做树形dp来做.dp[u][0]表示进入结点时上一个正权值,dp[…