#include #include #define N 1005using namespace std ;char s1[N],s2[N];int dp[N][N],ans,len1,len2;int max(int a,int b){ return a>b ? a : b ; }int f(in....
分类:
其他好文 时间:
2014-08-12 21:29:24
阅读次数:
175
#include #include #define N 1005using namespace std ;char s1[N],s2[N];int dp[N][N],ans,len1,len2;int max(int a,int b){ return a>b ? a : b ; }int f(in....
分类:
其他好文 时间:
2014-08-12 21:29:14
阅读次数:
219
#include int n,ans, a[1001],b[1001];int main(){int i,j;scanf("%d",&n);for(i=1;ia[j]&&b[j]+1>b[i]) b[i]=b[j]+1;ans=1;for(i=1;i<=n;i++)if(ans<b[i]) ...
分类:
其他好文 时间:
2014-08-12 21:27:14
阅读次数:
248
答案只有2种情况,所以ans = rand()%2;
if(ans)puts("happy") else puts("unhappy");
==
想过无源汇的网络流,还是比较麻烦的,然后没往下想。。。
设s点集有一些点,
多加一个点一定是y增加比较快_(:зゝ∠)_
然后设s点集只有一个点
#include
#include
#include
#include
us...
分类:
其他好文 时间:
2014-08-12 19:08:54
阅读次数:
204
#include #include#includeusing namespace std;char a[10002];int b[10002];int n,ans;int dp(int x){ int i,j,max; b[0]=1; for(i=1;i>n;for(i=1;i#include#.....
分类:
其他好文 时间:
2014-08-12 18:57:04
阅读次数:
183
//记忆式搜索 #include #include#includeusing namespace std;char a[10002];int b[10002];int n,ans;int f(int x){ int i,t; if(b[x]>0) return b[x]; b[x]=1; for(....
分类:
其他好文 时间:
2014-08-12 18:43:24
阅读次数:
138
#include #include#includeusing namespace std;char a[10002];int b[10002];int n,ans;int f(int x){ int i,t; for(i=0;i>n;for(i=1;i#include#includeusing n....
分类:
其他好文 时间:
2014-08-12 18:31:24
阅读次数:
294
hnldyhy(303882171) 11:28:19poj 1088//DP #include using namespace std; int a[102][102],b[102][102]; int r, c,ans; int f( int i, int j ) { int max...
分类:
其他好文 时间:
2014-08-12 18:18:14
阅读次数:
223
/************************************************************************/
/*
递归问题:
给定一个区间,求其中所有0~9数字总计出现次数
思路:
设f(a),f(b)为各自从1开始到a,b中所有0~9数字总计出现次数。
则ans=f(b)-f(a-1);递归的话就是建立f(k)和f(10*k+x)的关系.
对于一...
分类:
其他好文 时间:
2014-08-12 17:25:44
阅读次数:
182
题目连接:uva 11971 - Polygon
题目大意:给定一个长度为N的线段,要求切K刀,分成K+1个线段,问能组成K+1边形的概率。
解题思路:K条线段能组成K边形的条件为任意一条边小于其他所有边的和,因为是求概率,所以和N无关。
根据高中线性规划的知识,以二维为例:
所以有ans=2K?K?12K
#include
#include
#include
usi...
分类:
其他好文 时间:
2014-08-12 13:43:40
阅读次数:
262