- 博客(6)
- 资源 (1)
- 收藏
- 关注
原创 hdoj 3283
上次训练的题目 昨天WA一直找不到原因 原来是BIGGEST拼成BIGGSET~ 实在让我恍然大悟~搜了一下 别人用了STL的函数 ~接下来得学学了~ #include using namespace std;int a[82];char c[82];void isort(int e){ int i,j,temp; for(i=0;i for(j=i+1;j if(a[i]
2010-03-31 08:37:00 288
原创 hdoj 1160
先对fweight 排升序 之后就只要考虑speed了 注意weight 有可能相等 题目要求的是严格的升序而就转换成求 最长不连续递减子序列了~ #include using namespace std;struct mouse{ int w; int s; int order;} m[1005];int f[1005],t[1005],ans[1005];int cm
2010-03-26 16:37:00 403
原创 hdoj 1159
看了师兄的思路做出来的~f(i,j)=f(i-1,j-1)+1 (a==b[j])f(i,j)=max(f(i-1,j),f(i,j-1)) (a!=b[j]) #include using namespace std;char X[1005],Y[1005];int table[1005][1005];int main(){ int xlen,ylen,i,j,t; while(s
2010-03-26 14:00:00 428
原创 hdoj 1257
最少拦截系统题目没有给出输入数据的个数 所以使用边输入边处理每次总是使用已使用系统中较小的 所以用到qsort() #include using namespace std;int cmp(const void *a,const void *b){ return *(int *)a-*(int *)b;}int main(){ int n,i,j,t,num; int high[2
2010-03-24 19:41:00 373
原创 hdoj 2100
这里要注意存字符的时候是反过来的! #includeusing namespace std;char a[210],b[210];int sum[210];int main(){ int i,j,k,a_len,b_len; while(scanf("%s%s",&a,&b)!=EOF) { memset(sum,0,sizeof(sum)); a_len=strlen(a); b_
2010-03-10 14:22:00 399
原创 hdoj 2154
在论坛上看到别人推出来的,说说我的理解。 f[n]=f[n-1]+2*f[n-2] 第n项相当于在 n-2 项前加BA 和 CA,在n-1项前加 B 或 C。 之间并没有出现重复。 #include using namespace std; int main() { int a[1001],i,n; a[1]=0; a[2]=2; fo
2010-03-07 22:05:00 609 2
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人