HDOJ 5288 OO’s Sequence 水】的更多相关文章

预处理出每一个数字的左右两边能够整除它的近期的数的位置 OO's Sequence Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1880    Accepted Submission(s): 672 Problem Description OO has got a array A of size n ,defined a fun…
题目传送门 /* 定义两个数组,l[i]和r[i]表示第i个数左侧右侧接近它且值是a[i]因子的位置, 第i个数被选择后贡献的值是(r[i]-i)*(i-l[i]),每个数都枚举它的因子,更新l[i], r[i],复杂度O(n*sqrt(a[i])) */ #include <cstdio> #include <cmath> #include <algorithm> #include <cstring> #include <map> using…
OO's Sequence 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5288 Description OO has got a array A of size n ,defined a function f(l,r) represent the number of i (l<=i<=r) , that there's no j(l<=j<=r,j<>i) satisfy ai mod aj=0,now OO wan…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5288 //*************头文件区************* #include<iostream> #include<cstdio> #include<vector> #define N 100010 #define P 1000000007 using namespace std; int n,tmp,i,j; int r[N], l[N], q[N], a[N…
 HDU 5288 OO’s Sequence http://acm.hdu.edu.cn/showproblem.php?pid=5288 OO has got a array A of size n ,defined a function f(l,r) represent the number of i (l<=i<=r) , that there’s no j(l<=j<=r,j<>i) satisfy a i mod a j=0,now OO want to k…
题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=5288 题面: OO's Sequence Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 985    Accepted Submission(s): 375 Problem Description OO has got a arra…
OO’s Sequence Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1549    Accepted Submission(s): 559 Problem Description OO has got a array A of size n ,defined a function f(l,r) represent the nu…
OO's Sequence Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1751    Accepted Submission(s): 632 Problem Description OO has got a array A of size n ,defined a function f(l,r) represent the n…
OO's Sequence                                                          Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)                                                                                             T…
二分寻找对于指定pos的最左因数点和最右因数点. /* 5288 */ #include <iostream> #include <string> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #include <deque> #include <algorithm> #includ…