- 博客(28)
- 资源 (13)
- 收藏
- 关注
原创 zb的生日
http://acm.nyist.net/JudgeOnline/problem.php?pid=325#include#define abs(x) (x)>0?(x):-(x)int n,arr[22],sum,min,temp,t,num;void dfs(int pos){ int i; if((t=abs(sum-2*temp)) min=t;
2015-02-15 16:10:11 392
转载 Max Sum Plus Plus
http://acm.hdu.edu.cn/showproblem.php?pid=1024http://www.cnblogs.com/kuangbin/archive/2011/08/04/2127085.html
2015-02-14 23:57:00 445
原创 Sticks
http://acm.nyist.net/JudgeOnline/problem.php?pid=293#include #include using std::sort;int stick[66], n, sum, len, ok, temp;bool vis[66];bool cmp(int a, int b){ return a > b;}bo
2015-02-14 00:25:26 445
原创 Piggy-Bank完全背包
http://acm.hdu.edu.cn/showproblem.php?pid=1114#include#includeint dp[10010];struct piggy_bank{ int value; int weight;}s[600];int main(){ int t,e,f,n,i,j,sub; scanf("%d",&t)
2015-02-12 00:55:51 413
原创 坦克大战
http://acm.nyist.net/JudgeOnline/problem.php?pid=284#include#includechar map[310][310];int step[310][310],x1,y1,x2,y2,n,m;void dfs(int a,int b,int x,int y){ if(x return; if(map[
2015-02-11 22:39:22 370
原创 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活//0-1背包和多重背包
http://acm.hdu.edu.cn/showproblem.php?pid=2191#include#include#define max(x,y) (x>y?x:y)int main(){ int i,j,C,n,m,p,h,c,a[4010],b[4010],dp[4010],k; scanf("%d",&C); while(C--) {
2015-02-08 23:26:40 457
原创 How many ways
http://acm.hdu.edu.cn/showproblem.php?pid=1978#include#includeint main(){ int map[130][130],n,m,i,j,k,l,temp,t; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); memset(map,0
2015-02-08 20:20:20 300
原创 Doing Homework again
http://acm.hdu.edu.cn/showproblem.php?pid=1789#include#includeint main(){ int i,j,t,k,n,ans,a[1100],b[1100],c[1100]; scanf("%d",&t); while(t--) { scanf("%d",&n); for(i=0;i
2015-02-08 19:29:36 253
原创 Humble Numbers
http://acm.hdu.edu.cn/showproblem.php?pid=1058#include#define min(a,b) (a>b?b:a)#define min4(a,b,c,d) min(min(a,b),min(c,d))int a[6000];int main(){ int n=1,p2=1,p3=1,p5=1,p7=1; a[1
2015-02-08 18:06:36 315
原创 搬寝室
http://acm.hdu.edu.cn/showproblem.php?pid=1421#include#include#define min(x,y) x>y?y:xint dp[2001][2001];int main(){ int n,k,i,j,a[2001],t; while(scanf("%d%d",&n,&k)!=EOF) { f
2015-02-07 23:37:13 312
原创 一笔画问题
http://acm.nyist.net/JudgeOnline/problem.php?pid=42#include#includeint a[1010],vis[1010],m[1010][1010],p,q;void dfs(int n){ int i; vis[n]=1; for(i=1;i if(m[n][i]==1 && vis[i]==0
2015-02-07 22:51:53 577
原创 找出从自然数1、2、... 、n(0<n<10)中任取r(0<r<=n)个数的所有组合
http://acm.nyist.net/JudgeOnline/problem.php?pid=32#include#includeint visit[20],a[20],n,r,b[20];void dfs(int num){ int i; if(num==r) { for(i=0;i printf("%d",b[i]); putch
2015-02-07 16:50:53 5350
原创 Common Subsequence经典DP,最长公共子序列
http://acm.hdu.edu.cn/showproblem.php?pid=1159#include#include#define max(x,y) x>y?x:yint dp[1000][1000];int main(){ char a[1000],b[1000]; int i,j,a1,b1; while(scanf("%s%s",a,b)!
2015-02-07 16:46:49 529
原创 Matrix Swapping II
http://acm.hdu.edu.cn/showproblem.php?pid=2830#include #include #include using namespace std;int cmp(int a,int b){ return a>b;}int main(){ int n,m,i,j,k,t,ans,num[1010],ro
2015-02-07 00:10:25 417
原创 Largest Submatrix
http://acm.hdu.edu.cn/showproblem.php?pid=2870#include#includeint a[1010][1010],b[1010][1010],c[1010][1010],l[1010],r[1010];int main(){ int n,m,i,j,area; char ch; while(scanf("%d%d
2015-02-06 19:51:24 676
原创 Beans
http://acm.hdu.edu.cn/showproblem.php?pid=2845#includeint dp[200010],a[200010],b[200010];#define max(x,y) x>y?x:yint main(){ int n,m,i,j; while(scanf("%d%d",&n,&m)!=EOF) { dp[0]
2015-02-06 17:09:03 313
原创 How to Type
http://acm.hdu.edu.cn/showproblem.php?pid=2577#include#include#define min(x,y) xint main(){ int n,i,j,dp[110][2],status,count; char a[110]; scanf("%d",&n); getchar(); while(n--
2015-02-06 00:26:59 386
原创 FATE二维完全背包
http://acm.hdu.edu.cn/showproblem.php?pid=2159#include#include#define max(x,y) x>y?x:yint main(){ int ans,n,m,k,s,i,j,a[110],b[110],e,dp[110][110],flag; while(scanf("%d%d%d%d",&n,&m,
2015-02-05 20:47:24 386
原创 I NEED A OFFER!
http://acm.hdu.edu.cn/showproblem.php?pid=1203#include#include#define min(x,y) xint main(){ int i,j,n,m,a[10010],sum; double b[10010],dp[10010]; while(scanf("%d%d",&n,&m),n||m) {
2015-02-05 16:42:15 298
原创 Monkey and Banana
http://acm.hdu.edu.cn/showproblem.php?pid=1069#include#include#define max(x,y) x>y?x:yint main(){ int num,t,i,j,k,a[3],count,maxsum[1000],max,sum,f=0; struct block { int x; i
2015-02-04 23:28:30 358
原创 命运
http://acm.hdu.edu.cn/showproblem.php?pid=2571#include#include#define max(x,y) x>y?x:yint main(){ int num,a[25][1010],n,m,i,j,sum[25][1010],k; scanf("%d",&num); while(num--) {
2015-02-04 18:22:28 337
原创 吝啬的国度
http://acm.nyist.net/JudgeOnline/problem.php?pid=20#include #include int map[100005];void DFS(int start){ int pre = map[start]; if (pre != 0) { DFS(pre); map[pre] = start;
2015-02-04 16:32:48 405
原创 Super Jumping! Jumping! Jumping!
http://acm.hdu.edu.cn/showproblem.php?pid=1087//居然没超时#include#includeint dp[5000000];int main(){ int n,a[1010],i,j,max; while(scanf("%d",&n),n) { for(i=0;i scanf("%d",a+i)
2015-02-03 20:53:47 411
原创 City Game
http://acm.hdu.edu.cn/showproblem.php?pid=1505#include#includeint a[1010][1010],l[1010],r[1010];int main(){ int j,n,m,i,num,max,res; char t[10]; scanf("%d",&num); while(num--)
2015-02-03 18:49:31 450
原创 Largest Rectangle in a Histogram4 1000 1000 1000 1000
http://acm.hdu.edu.cn/showproblem.php?pid=1506#include#include__int64 a[100010];__int64 s[100010],e[100010],ans,temp;int main(){ int n,i; while(scanf("%d",&n),n) { for(i=0;i
2015-02-03 00:00:31 396
原创 Max Sum5 6 -1 5 4 -7
http://acm.hdu.edu.cn/showproblem.php?pid=1003#include#include#define max(x,y) x>y?x:yint a[100010],dp[100010];int main(){ int m,i,j,n,begin[100010],max,sign; scanf("%d",&m);
2015-02-02 17:47:40 343
原创 最大连续子序列http://acm.hdu.edu.cn/showproblem.php?pid=1231
http://acm.hdu.edu.cn/showproblem.php?pid=1231#include#include#define max(x,y) x>y?x:yint main(){ int i,n,a[10010],dp[10010],begin[10010],max,sign; while(scanf("%d",&n),n) { for
2015-02-01 23:29:26 524
原创 0-1最大报销额
http://acm.hdu.edu.cn/showproblem.php?pid=1864#include#include#define max(x,y) x>y?x:yint dp[3000050];int main(){ int n,num,i,j,k; double pri,total[40],sum,pra,prb,prc,sum1; char
2015-02-01 15:52:37 544
MFCApplication.zip
2020-04-17
23种设计模式代码
2019-02-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人