上一页 1 ··· 4 5 6 7 8 9 10 11 下一页

2019年9月3日

2017 ACM/ICPC Asia Regional Shenyang Online E number number number 题解

摘要: 分析: 当n=1时ans=4=f(5)-1; n=2,ans=12=f(7)-1; n=3,ans=33=f(9)-1; 于是大胆猜想ans=f(2*k+3)-1。 之后用矩阵快速幂求解f(n)即可,O(logn)。 AC code: 1 #include<bits/stdc++.h> 2 usin 阅读全文

posted @ 2019-09-03 21:17 Caution_X 阅读(131) 评论(0) 推荐(0) 编辑

Aladdin and the Flying Carpet LightOJ 1341 唯一分解定理

摘要: 题意:给出a,b,问有多少种长方形满足面积为a,最短边>=b? 首先简单讲一下唯一分解定理。 唯一分解定理:任何一个自然数N,都可以满足:,pi是质数。 且N的正因子个数为(1+a1)*(1+a2)*(1+a3)*.......*(1+an)。 看了网络上很多人写的题解,普遍的做法是先找出N的所有正 阅读全文

posted @ 2019-09-03 09:40 Caution_X 阅读(158) 评论(0) 推荐(0) 编辑

2019年9月1日

2016 ACM-ICPC 青岛站网络赛G题 题解

摘要: 【参考博客】【https://blog.csdn.net/Tawn0000/article/details/82255682】 题意: 将n个数按照每k个一组来合并,合并需要花费的cost是两个数的长度和,问:在T的消费内将所有的数合并所需的最小的k。 分析: 合并之前要处理一下零头,因为每次取k个 阅读全文

posted @ 2019-09-01 22:14 Caution_X 阅读(178) 评论(0) 推荐(0) 编辑

2019年8月30日

LightOJ - 1370 Bi-shoe and Phi-shoe 欧拉函数 题解

摘要: 题目: Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for 阅读全文

posted @ 2019-08-30 22:06 Caution_X 阅读(193) 评论(0) 推荐(0) 编辑

UVA 583 分解质因数

摘要: Webster defines prime as:prime (prim) n. [ME, fr. MF, fem. of prin first, L primus; akin to L prior] 1: first intime: original 2 a: having no factor 阅读全文

posted @ 2019-08-30 16:48 Caution_X 阅读(344) 评论(0) 推荐(0) 编辑

UVA 10699 Count the factors 题解

摘要: Time limit3000 msOSLinux Write a program, that computes the number of different prime factors in a positive integer.InputThe input tests will consist 阅读全文

posted @ 2019-08-30 14:27 Caution_X 阅读(214) 评论(0) 推荐(0) 编辑

POJ 1061 青蛙的约会 题解

摘要: 青蛙的约会 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 139755 Accepted: 31803 Description 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上 阅读全文

posted @ 2019-08-30 14:07 Caution_X 阅读(314) 评论(0) 推荐(0) 编辑

[模板]求解线性同余方程

摘要: 求解a*x = b (mod p) #include<bits/stdc++.h> using namespace std; int exgcd(int a,int b,int& x,int& y) { int d=a; if(b){ d=exgcd(b,a%b,y,x); y-=(a/b)*x; 阅读全文

posted @ 2019-08-30 13:03 Caution_X 阅读(203) 评论(0) 推荐(0) 编辑

2019年8月29日

2018 ACM-ICPC徐州站网络赛 G题

摘要: There's a beach in the first quadrant. And from time to time, there are sea waves. A wave ( xxx , yyy ) means the wave is a rectangle whose vertexes a 阅读全文

posted @ 2019-08-29 23:02 Caution_X 阅读(250) 评论(0) 推荐(0) 编辑

UVA10831题解

摘要: Gerg's Cake Gerg is having a party, and he has invited his friends. p of them have arrived already, but a are runninglate. To occupy his guests, he tr 阅读全文

posted @ 2019-08-29 22:50 Caution_X 阅读(173) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 11 下一页

导航