上一页 1 ··· 8 9 10 11 12 13 14 下一页
摘要: /////////////////////////////////////////////////////////////////////////Inversion//逆序数序与其求原序#include<iostream>#include<string>using namespace std;char nor[100];long shuru[10000];long chu[... 阅读全文
posted @ 2010-05-11 10:18 VRS 阅读(355) 评论(0) 推荐(0)
摘要: /////////////////////////////////////////////////////////Digital Roots//位数和的因子#include<iostream>#include<string>using namespace std;char n[10000];int main(){ memset(n,-1,sizeof(n)); int nu... 阅读全文
posted @ 2010-05-11 10:17 VRS 阅读(174) 评论(0) 推荐(0)
摘要: /////////////////////////////////////////////////////////////////////////////Word Reversal//字符逆置#include<iostream.h>#include<string.h>char s[10000][1000];int i,j,k;int main(){ int m,n,jis... 阅读全文
posted @ 2010-05-11 10:17 VRS 阅读(350) 评论(0) 推荐(0)
摘要: ////////////////////////////////////////////////////////带括号矩阵连乘的模拟//使用stack来解决#include<iostream>#include<stack>#include<string>using namespace std;struct matrx{ int row; int col;}ma[... 阅读全文
posted @ 2010-05-11 10:16 VRS 阅读(360) 评论(0) 推荐(0)
摘要: ////////////////////////////////////////////////////////////FatMouse's Speed 白老鼠越大越慢//利用dp,与DNA序列相似#include<iostream>using namespace std;int st[1001][2], output[1001]; class Mouse{public: int si... 阅读全文
posted @ 2010-05-11 10:16 VRS 阅读(323) 评论(0) 推荐(0)
摘要: ///////////////////////////////////////////////////////////////////////猴子与香蕉//把每一种方块化为三个,先排序,再用n^2的dp#include<iostream>#include<algorithm>using namespace std;struct block{ int x; int y; in... 阅读全文
posted @ 2010-05-11 10:15 VRS 阅读(344) 评论(0) 推荐(0)
摘要: ////////////////////////////////////////////////////1090一道数学题//已知三点的坐标,求以此三点所确定的圆的周长//先用余弦定理cosα=(b^2+c^2-a^2)/(2bc),再求sinα,那么直径d=a/sinα,周长l=dπ#include<iostream>#include<... 阅读全文
posted @ 2010-05-11 10:14 VRS 阅读(268) 评论(0) 推荐(0)
摘要: //////////////////////////////////////////////////////1088约瑟夫问题// 这里我用了简化算法,参考以下的说明,只是有点不同先把第一个删掉,从第二个开始数,// 循环n-1遍(因为已去掉首个),最终剩下当前的第一个结束。#include<iostream>using namespace std;int main(){ int n;... 阅读全文
posted @ 2010-05-11 10:13 VRS 阅读(521) 评论(0) 推荐(0)
摘要: //////////////////////////////////////////////////////////////////最大子矩阵和问题#include<iostream>using namespace std;int MaxSum(int n,int *a){ int i; int b; b=0; int max=0; for(i=1;i<=n;i++) { if... 阅读全文
posted @ 2010-05-11 10:12 VRS 阅读(204) 评论(0) 推荐(0)
摘要: //////////////////////////////////////////////////////////Gene Assembly//DNA序列中最多gene序列//用贪心法,先以基因头位置对基因排序,再用静态链存储、搜索#include<iostream>using namespace std;#define MAX 1005long st[MAX][2],output[... 阅读全文
posted @ 2010-05-11 10:12 VRS 阅读(512) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 下一页