标签:des style blog http color os io strong for
389,207,155,300,299,170,158,65
6,1
#include<iostream> #include<cstring> #include<cstdio> using namespace std; #define MAXN 1000 #define INF 0x3f3f3f3f //AC int num[MAXN]; int f[MAXN]; int main() { freopen("input.txt","r",stdin); int i,j,k,x,y,z,n,m; n=1; while (scanf("%d,",&num[++n])>0); n--; int ans=0; num[0]=INF; for (i=1;i<=n;i++) { for (j=0;j<i;j++) { if (num[j]>=num[i]) f[i]=max(f[i],f[j]+1); ans=max(ans,f[i]); } } printf("%d,",ans); memset(f,0,sizeof(f)); f[0]=0; ans=0; for (i=1;i<=n;i++) { for (j=0;j<i;j++) { if (num[j]<num[i]) f[i]=max(f[i],f[j]+1); ans=max(ans,f[i]); } } printf("%d\n",ans-1); return 0; }
tyvj P1209 - 拦截导弹 平面图最小割&&模型转化
标签:des style blog http color os io strong for
原文地址:http://www.cnblogs.com/mhy12345/p/3952213.html