2012年7月31日

HDU 4320 Arcane Numbers 1

摘要: 题意:一个有限数数从A进制转换为B进制,如果依然是有限数输出YES,否则NO算法:只要检查A中的质因子 是否都在 B中被包含。刚开始二了,分别把每个数分解质因数,然后二分查找是否存在果断TLE。分解A的质数prime[i]时,就用B%prime[i]判断是否整除。。。同时进行View Code #include<stdio.h>#include<string.h>#include<iostream>#include<vector>#include<string>#include<math.h>#include<map 阅读全文

posted @ 2012-07-31 22:18 more think, more gains 阅读(176) 评论(0) 推荐(0) 编辑

HDU 4325 线段树离散化

摘要: 线段树离散化1.输入完所有数据,对开花时间离散化2.区间更新,点查询,LAZY操作。。View Code #include<stdio.h>#include<stdlib.h>#include<string.h>#include<iostream>#include<vector>using namespace std;#define MAXN 51000struct node{ int left, right; int num; int sum; int lazy;}seg[500010];int N, M;struct flower 阅读全文

posted @ 2012-07-31 20:16 more think, more gains 阅读(183) 评论(0) 推荐(0) 编辑

Expression 暴力枚举

摘要: 算法:可以枚举所有状态,然后排序。View Code #include<stdio.h>#include<string.h>#include<stdlib.h>#include<vector>#include<algorithm>#include<iostream>#include<stack>#include<string>using namespace std;char str[1000];int f[1000];int main( ){ int T; scanf("%d", 阅读全文

posted @ 2012-07-31 07:50 more think, more gains 阅读(195) 评论(0) 推荐(0) 编辑

导航