自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

FLY的博客

Let There Be Light!

  • 博客(9)
  • 资源 (1)
  • 收藏
  • 关注

原创 POJ - 2478 Farey Sequence (欧拉函数)

原题链接:传送门 题意:给你一个函数 F(),F(n) 就是 1-n 之内两个数 gcd(a,b) = 1 的总个数。 思路:很显然,是求欧拉函数的。F(n) = F(n-1) + phi[i],直接套欧拉函数模板。 // #include <bits/stdc++.h> #include <iostream&amp

2018-11-27 21:00:40 157

原创 LightOJ - 1234 Harmonic Number(打表+技巧)

原题链接:传送门 题意:求调和级数的部分和。调和级数如下: 思路:这个题n的数据范围是1e8,直接开数组存不下,可以降值来存,就是每100个数的调和级数存一下。最后再把剩余的遍历一下就好了,时间复杂度也降下来了。 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e8+...

2018-11-27 12:55:39 164

原创 LightOJ - 1220 Mysterious Bacteria(唯一分解定理+思维)

原题链接:传送门 题意:输入 t 组数n,每个数n = bp,求 p 的最大值。 思路:一开始以为是求 n = b1p1 * b2p2 * b3p3 * … *bnpn 中的最大的p,后来才注意到是 n = bp 中 p 的最大值… 可以先用唯一分解定理求出b1,b2,b3…bn,然后求出b1到bn的gcd,就是n = bp了。如12 = 22 * 3,那么12 = 121,gcd(2,1) =...

2018-11-19 18:23:15 154

原创 LightOJ - 1214 Large Division(高精度取模)

原题链接:传送门 题意:给你两个数a和b,问你a是否能整除b。(-10200 ≤ a ≤ 10200),b是32位有符号整型。 思路:用一个数1234举例,可以写成 ( ( ( ( (1 * 10) + 2) * 10) + 3 ) * 10 ) + 4,而根据(m+n)%Mod = (m%Mod) + (n%Mod) ) % Mod,可以求出b是否可被a整除 #include <bit...

2018-11-15 10:41:52 257

原创 几种常用求素数方法

6n+1法 判断素数 #include <bits/stdc++.h> using namespace std; bool isprime(int n){ //判断素数 double n_sqrt = double(sqrt(n)); if(n == 1) return false; if(n==2 || n==3) ...

2018-11-14 21:41:31 2054

原创 Educational Codeforces Round 54 (Rated for Div. 2) C - Meme Problem(数学)

原题链接:传送门 题意:给你一个数d,问是否存在 a 和 b,使得a + b = d 并且a * b = d,没有输出N,有则输出Y并输出a 和 b 的值. 思路:联立两个方程组,得到一个一元二次方程 a2 - ad + d = 0,即 x2 - ax + a = 0.即可求出 a ,b. #include <bits/stdc++.h> typedef long long ll; u...

2018-11-14 20:28:12 179

原创 Educational Codeforces Round 54 (Rated for Div. 2) B.Divisor Subtraction (素数 + 思维)

原题链接:传送门 Description outputstandard output You are given an integer number n. The following algorithm is applied to it: 1.if n=0, then end algorithm; 2.find the smallest prime divisor d of n; 3.subtr...

2018-11-14 19:47:16 184

原创 LightOJ - 1259 Goldbach`s Conjecture(素数)

原题链接:传送门 Description Goldbach’s conjecture is one of the oldest unsolved problems in number theory and in all of mathematics. It states: Every even integer, greater than 2, can be expressed as the su...

2018-11-08 11:04:20 139

原创 LightOj 1282 Leading and Trailing(快速幂取模 + 对数)

原题链接:传送门 Description You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk. Input Input starts with an integer T (≤ 10...

2018-11-06 18:17:23 138

第十届蓝桥杯C/C++,A、B组省赛题目

第十届蓝桥杯C/C++,A组B组省赛试题

2019-03-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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