摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1754线段树功能:#include<cstdio>#include<cstdlib>#include<cmath>#include<cstring>#define MAXN 200005int seg_tree[MAXN<<2];void build_tree(int l,int r,int id);int query_tree(int left,int right,int l,int r,int id);void update_point_tree 阅读全文
posted @ 2012-05-28 04:47
woaiyy
阅读(173)
评论(0)
推荐(0)
摘要:
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1166#include<cstdio>#include<cstdlib>#include<cmath>#include<cstring>#define MAXN 50005int seg_tree[MAXN<<2];void build_tree(int l,int r,int id);int query_tree(int left,int right,int l,int r,int id);void update_point_tree(i 阅读全文
posted @ 2012-05-28 04:06
woaiyy
阅读(218)
评论(0)
推荐(0)
摘要:
线段树:旨在自己看,题目来源与报告来自http://www.notonlysuccess.com/index.php/segment-tree-complete/是某位大牛写的,很犀利。。。(1):单点更新 HDU 1166敌兵布阵 http://acm.hdu.edu.cn/showproblem.php?pid=116View Code #include<cstdio>#include<cstdlib>#include<cmath>#include<cstring>#define MAXN 50005int seg_tree[MAXN< 阅读全文
posted @ 2012-05-28 04:03
woaiyy
阅读(321)
评论(0)
推荐(0)
摘要:
哈沙德数 - 介绍若一个数无论在任何进位制中都是哈沙德数,称为全哈沙德数(全尼云数)。只有四个全哈沙德数:1,2,4,6。所有在零和进位制的底数之间的数都是哈沙德数。除非是个位数,否则素数不是哈沙德数。在十进制中,100以内的哈沙德数:10,12,18,20,24,27,30,36,40,42,45,48,50,54,60,63,70,72,80,81,84,90,100...#include<cstdio>#include<cstdlib>#include<cmath>#include<cstring>int main(){int n,ans1 阅读全文
posted @ 2012-05-28 01:34
woaiyy
阅读(364)
评论(0)
推荐(0)
摘要:
代码:#include<cstdio>#include<cstdlib>#include<cmath>int main(){ int n,m,tcase,k,i,j,a,b,m_count; while(scanf("%d",&tcase)==1) { for(i=0;i<tcase;i++) { if(i) printf("\n"); k=1; while(scanf("%d%d",&n,&m)&&(n||m)) { ... 阅读全文
posted @ 2012-05-28 01:03
woaiyy
阅读(206)
评论(0)
推荐(0)