poj1887
来源:互联网 发布:wcf框架源码 编辑:程序博客网 时间:2024/04/30 11:18
最长下降子序列
#include<stdio.h>#include<stdlib.h>#include<string.h>#define INF 40000int c[40000],len;int find(int l,int r,int a){ int mid=(l+r)/2; while(l<r) { if(c[mid]>a) l=mid+1; else r=mid; mid=(l+r)/2; } return r;}int main(){ int a,count=0,j,i; while(scanf("%d",&a)!=EOF&&(a!=-1)) { j=0;len=0; c[0]=INF; count++; c[1]=a;len++; while(scanf("%d",&a)!=EOF&&(a!=-1)) { if(a<c[len]) j=++len; else j=find(1,len,a); c[j]=a; } printf("Test #%d:\n",count); printf(" maximum possible interceptions: %d\n\n",len); } return 0;}
0 0
- poj1887
- poj1887
- poj1887
- poj1887
- POJ1887
- poj1887
- POJ1887--Testing the CATCHER
- poj1887 Testing the CATCHER
- POJ1887 Testing the CATCHER
- POJ1887 Testing the CATCHER
- poj1887 Testing the CATCHER
- poj1887最长降子序列
- poj1887(最长递减子序列)
- poj1887(最长下降子序列)
- POJ1887 最长下降子序列
- POJ1887 Testing the CATCHER(lis)
- poj1887(最长下降子序列)
- poj1887——Testing the CATCHER
- 软件工程教学博客 (备份)
- 期望
- 软件教育随想
- 两千块钱带来的 "希望"
- 一些有意思的程序员常去的博客 [zz]
- poj1887
- 给将要进入职场的同学 - 开发软件不是闭卷考试
- 软件随想: 软件 = 程序 + 软件工程
- 现代软件工程系列 学生的精彩文章 (1)
- 现代软件工程系列 学生的精彩文章 (2) 到底是谁的 bug?
- 现代软件工程系列 学生的精彩文章 (3) 如何在Bug 不断的情况下还能保持平常心... [zz]
- How to set the I/O Queue depth on VMware ESX servers?
- 现代软件工程系列 学生的精彩文章 (4) 为用户服务
- Maven管理的jar没有发布到WEB-INF/lib下的解决方案