随笔分类 -  POJ

poj3670 eating together 简单的dp
摘要:方法一:LIS/LDS#include"stdio.h" int lis[30001],lds[30001]; int main() { int n,t,len1=0,len2=0,i,left,right,mid; lds[0]=0x7fffffff; lis[0]=-1; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&t); if(t>=lis[le... 阅读全文

posted @ 2012-03-06 17:02 andy_ 阅读(233) 评论(0) 推荐(0)

POJ 1328 Radar Installation 贪心
摘要:#include"stdio.h" #include"math.h" #include"stdlib.h" typedef struct { double x1,x2; }POINT; int cmp(const void *a,const void *b) { return (*(POINT *)a).x1>(*(POINT *)b).x1?1:-1; } POINT t[1000]; main() { int n,d,ans,i=0,j,judge,tag; double tx,ty; while(scanf... 阅读全文

posted @ 2012-02-28 20:58 andy_ 阅读(175) 评论(0) 推荐(0)

导航