WangMeow --- ᶘ ᵒᴥᵒᶅ ฅ^•ﻌ•^ฅ

欲穷算法千里目,更上编程一层楼!

[LightOJ](1236)Pairs Forming LCM ---- 唯一分解定理(质因数分解)

Find the result of the following code: long long pairsFormLCM( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) ...

2018-06-22 19:39:47

阅读数:44

评论数:0

Codeforces Round #489 (Div. 2) ---- B. Nastya Studies Informatics (数学)

题目链接:http://codeforces.com/contest/992/problem/B 题意: 给你一个范围[l,r],和x,y,让你求在范围内,满足gcd(a,b) = x,lcm(a,b) = y的数对(a,b)有多少个。 思路: 普通人的枚举思路是过不了啊QAQ(来自超霸的藐视...

2018-06-19 18:14:16

阅读数:40

评论数:0

Codeforces Round #486 (Div. 3) ---- C. Equal Sums (map的应用)

题目链接:http://codeforces.com/contest/988/problem/C 题意: 给你k个序列,让你从中选两个序列,分别从两个序列中删除一个元素使得两个序列的和相等。输出删除的两个元素分别在第几个序列的第几个 思路: 一开始写了一个极复杂的容器混合QAQ(不说了) 然...

2018-06-14 22:56:23

阅读数:15

评论数:0

Codeforces Round #487 (Div. 2) ---- B.A Tide of Riverscape

题目链接:http://codeforces.com/contest/989/problem/B 题意: 给你一个串S由可能由’1’, ‘0’, ‘.’这三种字符组成,其中’.’表示它可能为‘1’或者为‘0’。它让你保证这个串中按照每p为一个周期,只有存在一对s[i]和s[i+p]是不相同的字符...

2018-06-12 12:54:20

阅读数:22

评论数:0

[LightOJ](1220)Mysterious Bacteria ---- 唯一分解定理(质因数分解)

Dr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction system. RC-01 lives exactly x days. Now RC-0...

2018-06-11 15:33:21

阅读数:70

评论数:0

[YTU](3273)吃鸡之团队合作 ---- BFS

Description 暑假就要开始啦!小伙伴们又可以肆无忌惮的开黑吃鸡了喵!我们知道开黑吃鸡最重要的当然是团队合作了。在一个地图中,一个小队的玩家之间的距离不能太远,这样当队友遇到危险被击倒时才能保证有队友可以在足够的时间内赶过去。现在,我们有一个N*N的地图,其中“#”表示无法跨越的障碍物,...

2018-06-09 18:45:32

阅读数:108

评论数:0

[UVA](10200)Prime Time ---- 前缀和+素数

Euler is a well-known matematician, and, among many other things, he discovered that the formula n 2 + n + 41 produces a prime for 0 ≤ n &l...

2018-06-07 19:51:59

阅读数:29

评论数:0

[UVA](11827)Maximum GCD ---- 暴力+ungetc()函数

Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these integers. Input The first line ...

2018-06-07 17:28:06

阅读数:28

评论数:0

[LightOJ](1245)Harmonic Number (II) ---- 调和级数(规律)

I was trying to solve problem ‘1234 - Harmonic Number’, I wrote the following code long long H( int n ) { long long res = 0; for( int i = ...

2018-06-05 20:59:07

阅读数:20

评论数:0

[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 hi...

2018-06-04 19:30:16

阅读数:30

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭