摘要: 题意: 给你一个 n 个人的队列,从中去掉一些人使剩下的人满足 任何一个人可以看到他 至少一侧的所有人。分析: 从前往后 和 从 后往前分别 求一次LIS,然后枚举分割点。View Code #include<stdio.h>#include<string.h>int main(){ int res,n,i,j,tmp; double a[1002]; int dp1[1002]; int dp2[1002]; while(scanf("%d",&n)!=EOF) { for(i=1;i<=n;i++) scanf("%l.. 阅读全文
posted @ 2012-04-28 21:37 'wind 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 题意: 给你 n 个绳子,从里面选出任意根绳子,求最大承受力, 当承受力大的和小的放在一起时,每个绳子的承受力和小的一样,分析: 先对绳子排序,然后求出以每个绳子为最小承受力的绳子的最大值。View Code #include<stdio.h>#include<stdlib.h>int cmp(const void*p1,const void*p2){ return *(int*)p1-*(int*)p2;}int a[10005];int main(){ int t,n,i; scanf("%d",&t); while(t--) { sca 阅读全文
posted @ 2012-04-28 19:58 'wind 阅读(185) 评论(0) 推荐(0) 编辑