摘要:
splay#include#include#include#include#define maxn 300009#define lch(rt) son[rt][0]#define rch(rt) son[rt][1]using namespace std;int son[maxn][2],fa[maxn],size[maxn],val[maxn],st[maxn];int root,cnt;int num[maxn],flg[maxn];int n,m;void push_up(int rt){ size[rt]=size[lch(rt)]+size[rch(rt)]+1;}void p... 阅读全文
摘要:
简单dp#include#define maxn 10005#include#includeusing namespace std;double dp[140][maxn];double t[140][140];int num[maxn];int main(){ int n,m; while(scanf("%d",&m)!=EOF) { m=(m*(m-1)*(m-2)/6); for(int i=0; ima2)ma2=dp[i][j]; } ma1=ma2; } ma1=0... 阅读全文