摘要: http://ac.jobdu.com/problemstatus.php?pid=1543#include#include#include#includeusing namespace std;//#define llu dtypedef unsigned long long lld;const int Max = 1000;int path[Max];void getP_Q(lld n, lld &p, lld &q){ int cnt = 0; lld tmp; while (n != 1) { tmp = n>>1; if (n ==... 阅读全文
posted @ 2013-10-07 23:23 forgood 阅读(146) 评论(0) 推荐(0) 编辑
摘要: http://ac.jobdu.com/problem.php?pid=1544#include #include #include #include const int Maxint = 0x7fffffff;const int Max = 200010;int node[Max];int data[Max];void createSegTree(int L, int R, int root){ if (L == R) { node[root] = data[L]; return ; } int mid = (L + R) / 2; createSegTree(L, mid, root .. 阅读全文
posted @ 2013-10-07 14:19 forgood 阅读(150) 评论(0) 推荐(0) 编辑