摘要:
FootballTime Limit:1000MSMemory Limit:65536KTotal Submissions:3469Accepted:1782DescriptionConsider a single-elimination football tournament involving ... 阅读全文
摘要:
Scout YYF ITime Limit:1000MSMemory Limit:65536KTotal Submissions:5565Accepted:1553DescriptionYYF is a couragous scout. Now he is on a dangerous missio... 阅读全文
摘要:
一、整数m ^ n % k 的快速幂:ll quickpow(ll m, ll n , ll k){ ll ans = 1; while(n){ if(n & 1)//如果n是奇数 ans = (ans * m) % k; n = n... 阅读全文
摘要:
EXAMPLE: 递推式: d(n + 2) = p * d(n + 1) + (1 - p) * d(n); 令G(n) = (d(n + 2), d(n + 1))^T; 则 G(n + 1) = M * G(n); 解得 M = p 1 - p 1 0 G(n) = (M ^ ... 阅读全文
摘要:
#include #define N 30010int pa[N]; //parentint siz_tree[N]; //size of treeint d[N]; //dist between node and rootint Find(int x){ if(pa[x] == x) ret... 阅读全文
摘要:
一定要注意swap(x, y),x, y可能相邻!#include #define N 100005#define ll long longint n, m;struct node{ int l, r; node() : l(0), r(0) {} node(int l_, int r_) :... 阅读全文