LeeBlog

导航

2011年5月17日 #

HDU 1171 Big Event in HDU 多重背包

摘要: 这题是我第一次写多重背包,1RE,1WA,#include<stdio.h>#include<string.h>int n,v[55],num[55],dp[250000],sum,all;int max( int a,int b ){ return a > b ? a : b;}int main( ){ while( scanf( "%d",&n ),n > 0 ) { sum = 0; for( int i = 0; i < n; ++i ) scanf( "%d%d",&v[i],& 阅读全文

posted @ 2011-05-17 23:47 LeeBlog 阅读(263) 评论(0) 推荐(0) 编辑

分糖果 二进制不进位相加

摘要: 那天比赛时还有一题,分糖果。当时看了没神马头绪,就没看了。这是地址http://218.75.208.59:8084/acmhome/problemdetail.do?&method=showdetail&id=1061分糖果时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交:14 测试通过:11描述肖恩和帕特里克是兄弟,他们从他们的父母那里得到了很多糖果。每一块糖具有一个的正整数的价值,孩子们希望分他们得到的糖果。首先,肖恩将这些糖果分成两堆,并选择一堆给帕特里克。然后,帕特里克将尝试计算每堆的价值,其中每堆的价值是在那堆的糖果价 阅读全文

posted @ 2011-05-17 13:54 LeeBlog 阅读(1277) 评论(0) 推荐(0) 编辑

我素故我在

摘要: 这是我们学校本届的校赛题目,链接:http://218.75.208.59:8084/acmhome/problemdetail.do?&method=showdetail&id=1060题目描述:我素故我在时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交:20 测试通过:11描述有这样一种素数叫纯素数(YY出来的名字),当它是一个多位数的时候,你把它的末位去掉之后余下的数依然是一个素数。比如说2393,2393 本身是一个素数,它的末位去掉之后,余下的是239。239 是一个素数,它的末位去掉之后,余下的是23 。23是一个素数 阅读全文

posted @ 2011-05-17 13:09 LeeBlog 阅读(463) 评论(1) 推荐(0) 编辑

ACM 入门计划

摘要: acm本文由swellspirit贡献ACM• I can accept failure. but I can't accept not trying.Life is often compared to a marathon, but I think it is more like being asprinter; long stretches of hard work punctuated by brief moments in which weare given the opportunity to perform at our best. If someone gets the 阅读全文

posted @ 2011-05-17 11:47 LeeBlog 阅读(3025) 评论(4) 推荐(3) 编辑