HDU 4630、BOJ 某题】的更多相关文章

No Pain No Game Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2000    Accepted Submission(s): 851 Problem Description Life is a game,and you lose it,so you suicide. But you can not kill yours…
id=45786" style="color:blue; text-decoration:none">HDU - 4630 id=45786" style="color:blue; text-decoration:none">No Pain No Game Time Limit: 2000MS   Memory Limit: 32768KB   64bit IO Format: %I64d & %I64u Submit Sta…
两道离线线段树. 比赛时候没想到.... 扫描数组,i从1到n,线段树维护从1到i每一个约数(1~50000)的出现的最近位置,线段树存储的是约数的最大值 #include<cstdio> #include<cstring> #include<vector> #include<algorithm> using namespace std; const int N=50050; struct Interval{ int l,r,id; }in[N]; stru…
No Pain No Game Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17    Accepted Submission(s): 5 Problem Description Life is a game,and you lose it,so you suicide.But you can not kill yourself be…
1.HDU  1102  Constructing Roads    最小生成树 2.总结: 题意:修路,裸题 (1)kruskal //kruskal #include<iostream> #include<cstring> #include<cmath> #include<queue> #include<algorithm> #include<cstdio> #define max(a,b) a>b?a:b using na…
http://acm.hdu.edu.cn/showproblem.php?pid=4630 离散化+树状数组 将数组 *a  从后向前遍历 遍历到 a[x] 的时候 再枚举a[x]的约数 假如 约数 k last[k] 对应到 上一个k出现的位置  那么可被公约数 k 更新的区间是   last[k] --- 最后 把所有a[x]的约数都处理完之后  从 x 到任意 y(y>=x)形成的段的 最优解都可求 代码: #include<iostream> #include<cstdi…
题目: http://acm.hdu.edu.cn/showproblem.php?pid=4493 题意我都不好意思说,就是求12个数的平均数... 但是之所以发博客,显然有值得发的... 这个题最坑的地方就是结果精确到便士,也就是小数点后2位,不输出后缀0,所以需要处理一下输出格式. 一开始我是用c语言这样写的: #include <stdio.h> #include <string.h> int main() { int t; scanf("%d", &a…
Cyclic Tour Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others) Total Submission(s): 1120    Accepted Submission(s): 579 Problem Description There are N cities in our country, and M one-way roads connecting them. Now L…
GPA Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4802 Description In college, a student may take several courses. for each course i, he earns a certain credit (ci), and a mark ranging from A to F, which is c…
Delete Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5210 Description wld有n个数(a1,a2,...,an),他希望进行k次删除一个数的操作,使得最后剩下的n−k个数中有最多的不同的数,保证1≤n≤100,0≤k<n,1≤ai≤n(对于任意1≤i≤n) Input 多组数据(最多100组)对于每组数据:第一行:一个数n表示数的个数接下来一行:…