上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页
摘要: 这道题就是一道简单的欧拉函数模板题,需要注意的是,当(1,1)时只有一个,其他的都有一对。应该对欧拉函数做预处理,显然不会超时。 阅读全文
posted @ 2018-10-23 21:05 bluefly-hrbust 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 对于求某个数的欧拉函数,我们可以通过公式直接求解,这里做出简单证明 代码实现 阅读全文
posted @ 2018-10-23 21:00 bluefly-hrbust 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 这道题实在是不该,我在化式子的时候,多此一举,把式子进行累加,导致自己当时化的式子是错的,这样导致自己卡了很久,也没想到好的思路,赛后重新分析一波,感觉巨™简单。。。难受的一逼。 这道题的关键在于,W这个东西,由于W序列是受L和R区间变化的,它的取值是由f(i,j)决定的,那么我们知道,肯定要把f( 阅读全文
posted @ 2018-10-21 23:50 bluefly-hrbust 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 求满足GCD(a,b) = a XOR b; 其中1<=b <=a<=n。 首先做这道题需要知道几个定理: 异或:a XOR b = c 那么 a XOR c = b; 那么我们令GCD(a,b)= c; 这样 a 是 c 倍数。我们可以通过遍历c , 然后通过筛法,把c的倍数晒出当作a。求b如何求 阅读全文
posted @ 2018-10-20 23:22 bluefly-hrbust 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 没用运用好式子。。。想想其实很简单,首先应该分析,由于每次加一个LCM是大于等于其中任何一个数的,那么我LCM加在哪个数上面,那个数就是会变成大的,这样想,我们就知道,每个(x,y)对应就一种情况。 第二个突破口是,那个式子,我们可以想一想,是不是可以把数进行拆分,我们发现 a=x*k,b=y*k; 阅读全文
posted @ 2018-10-20 22:37 bluefly-hrbust 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #define ll long long using namespace std; int main(){ int n; int k=0; while(1){ k++; scanf("%d",&n); if (n==0)break; int m=sqrt(n+... 阅读全文
posted @ 2018-10-19 23:53 bluefly-hrbust 阅读(147) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #define rep(i,j,k) for(int i=j;i<=k;i++) using namespace std; const int N = 10007; bool is_prime[N]; int prime[N]; int cnt=0; void get_prime(){ int m=s... 阅读全文
posted @ 2018-10-19 22:58 bluefly-hrbust 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #define ll long long #define ULL unsigned long long using namespace std; const int maxx = 1e6+5; ll fac[maxx]; int pow_mod(ULL a,ULL n,ULL m){ if (n==0)... 阅读全文
posted @ 2018-10-19 21:13 bluefly-hrbust 阅读(179) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #define ll long long #define rep(i,j,k) for(int i=j;i<=k;++i) using namespace std; const int maxx = 1e4+7; ll a[maxx]; void ex_gcd(ll a,ll b,ll &d,ll &x,ll &y) { ... 阅读全文
posted @ 2018-10-19 21:12 bluefly-hrbust 阅读(115) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #define ll long long using namespace std; ll gcd(ll a,ll b){ return a%b==0?b:gcd(b,a%b); } int main(){ ll a,b; ll ans1,ans2; while(~scanf("%lld%lld",&a,&b)... 阅读全文
posted @ 2018-10-19 00:14 bluefly-hrbust 阅读(386) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页