摘要:
链接:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1390这道题,真的挺厉害,虽然用到的东西都不难,但是考察了很多方面,树状数组和二分,这个全用到了,并且还要记录是否访问过View Code 1 #include<stdio.h> 2 #include<string.h> 3 #define N 100005 4 int a[N]; 5 int used[N]; 6 int n; 7 int lowbit(int x) 8 { 9 return x&am 阅读全文
posted @ 2012-05-02 22:46
zhenhai
阅读(224)
评论(0)
推荐(0)
摘要:
链接:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1049这道题我是用的康托展开做的,优化了判断变化后的数的过程,这道题算是一道数学题吧,应该要算是组合数学里的View Code 1 #include<stdio.h> 2 #include<string.h> 3 #define N 370000 4 int used[N]; 5 int g[N];//存储数 6 int step[N];//每种状态需要的最小步数,为-1则不可达 7 int fac[1 阅读全文
posted @ 2012-05-02 19:55
zhenhai
阅读(489)
评论(0)
推荐(0)

浙公网安备 33010602011771号