题目链接题意 : 玩台球。Alice 和 Bob,一共可以进行m次,Alice
先打。有一个白球和n个标有不同标号的球,称目标球为当前在桌子上的除了白球以外的数值最小的球,默认白球的标号为0。如果白球落入洞中,要把白球拿出来放在桌子上,如果是其他的球就不拿哪怕是犯规打进去的。每打一局(每一局代表每人...
分类:
其他好文 时间:
2014-05-19 20:02:50
阅读次数:
233
题目来源:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3490题意: 给出两个集合Y
, N , 给出区间【low , high】 , 问在 这个区间有多少个这样的数,x , 满足, 集合Y中至少一个数被x 整除, 且 集合 ...
分类:
其他好文 时间:
2014-05-19 10:35:04
阅读次数:
256
给定n
k以及n个人已参加的比赛数,让你判断最少还能参加k次比赛的队伍数,每对3人,每个人最多参加5次比赛#include using namespace
std;int main(){ int n,k, cnt = 0; cin >> n >> k; for(int i = 0 ...
分类:
其他好文 时间:
2014-05-19 08:40:56
阅读次数:
239
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3769
Diablo III
Time Limit: 2 Seconds Memory Limit: 65536 KB
Diablo III is an action role-playing video game. A fe...
分类:
其他好文 时间:
2014-05-18 18:40:35
阅读次数:
345
A、Choosing Teams
水题
#include
#include
using namespace std;
int main()
{
int n, k, ans, i, x;
scanf("%d%d",&n,&k);
ans = 0;
for(i=0; i<n; ++i)
{
scanf("%d",&x);...
分类:
其他好文 时间:
2014-05-18 10:53:23
阅读次数:
262
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5235
Calculate the Function
Time Limit: 2 Seconds Memory Limit: 65536 KB
You are given a list of numbers A1 A2 .. AN...
分类:
其他好文 时间:
2014-05-18 09:52:49
阅读次数:
410
题目大意:
让每天都能吃到西瓜。最少需要花多少钱。
思路分析:
dp[pos] 就表示 要让 前i天每天都有西瓜吃,最少需要花多少钱。
那么如果你买这个西瓜的话。那么这个西瓜能吃的持续时间都要更新一下。
然后再在每个西瓜的更新部分取最小的,就可以是这个点所能得到的最小值。
其实就是 dp[i] = min (dp[i] , dp[ j - k +1] + a[j]);...
分类:
其他好文 时间:
2014-05-18 08:59:29
阅读次数:
244
A:A. Choosing Teams
.题目就不介绍了,直接统计即可。
AC代码:
#include
#include
#include
using namespace std;
int cnt[6];
int main()
{
int n,k,i,x;
while(cin>>n>>k)
{
memset(cnt,0,sizeof(cnt));...
分类:
其他好文 时间:
2014-05-18 08:41:02
阅读次数:
233
题目很像是有上下界的,因为限定了每个小孩最少分享的信息。后来听YYD大神的解释是,也许一个人可以多次分享同一个,所以下界可以无视。如果是这样,题目就好办了。
首先源点向所有人连边,如果不是要求的那个人,边容量就设为他的上界,如果是要求的那个人,边容量就设为无穷,因为他的所有信息都不需要别人共享。
人向自己有的信息连边,容量为1
信息连向汇点,容量为1.
#include
#incl...
分类:
其他好文 时间:
2014-05-18 08:19:26
阅读次数:
272
线段树维护的是区间有多少个空位置,每次查询第X个空位置在哪,sum[rt]>=X就向左区间找,sum[rt]
#include
#include
#include
using namespace std;
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
const int maxn = 55555;
int...
分类:
其他好文 时间:
2014-05-15 20:19:48
阅读次数:
256