递推公式,假设第一名有i个人并列,那么:
f[n] = C(n,i) * f[n - i];
打出1 ~ 1000的所有组合数,之后记忆化搜索,需要打表。
14026995
12034
Race
Accepted
C++
0.032
2014-08-12 11:47:47
#include
#include
#incl...
分类:
其他好文 时间:
2014-08-12 22:15:44
阅读次数:
178
#include #include using namespace std;int dp[105][1005], w[105],v[105],T,M,;int max(int x,int y) { return x>y?x:y; }int f(int x,int y){ int t; if (d.....
分类:
其他好文 时间:
2014-08-12 21:57:24
阅读次数:
339
借助securtCRT,使用linux命令sz可以很方便的将服务器上的文件下载到本地,使用rz命令则是把本地文件上传到服务器。 其中,对于sz和rz的理解与记忆我用了如下的方法(很多时候容易搞混): sz中的s意为send(发送),告诉客户端,我(服务器)要发送文件 send to cilent,就...
分类:
其他好文 时间:
2014-08-12 21:54:34
阅读次数:
334
#include using namespace std;int dp[105][1005],w[105],v[105] ;int max(int a,int b) { return a > b ? a : b; }int f(int x,int y){ int t ; if(dp[x][...
分类:
其他好文 时间:
2014-08-12 21:41:05
阅读次数:
273
#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
我一直在追寻这样这样的生活,且不止一次的跟我的朋友分享自己的生活态度,直到今天我突然发现自己好像找了一个看似合理实则荒谬的借口不去追寻不一样的生活。我是一个不是特别努力的人,但是事实却是我能够不厌烦的抄写下自己需要学习的文字概念,虽然这些概念只是需要记忆而已,也许我对自己的记忆能力已不再自信,也许不...
分类:
其他好文 时间:
2014-08-12 21:27:34
阅读次数:
219
//记忆式搜索 #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 #define MAX 50+1int a[MAX];int fib(int n){ if (a[n]==-1) return a[n]=fib(n-1)+fib(n-2); else return a[n]; }int main( ){ int i,n;...
分类:
其他好文 时间:
2014-08-12 18:33:44
阅读次数:
177
//记忆式搜索 #include #include using namespace std; int a[101][101],n,b[101][101]; int f(int i,int j) { if ( b[i][j]!=-1 ) return b[i][j]; if ( i==n...
分类:
其他好文 时间:
2014-08-12 18:15:44
阅读次数:
168
无脑搜,加个记忆化。当时只过了这题和A题#include #include #include #include #include #include #include #include #include #include #include #include #include using namespa...
分类:
其他好文 时间:
2014-08-12 16:34:44
阅读次数:
196