自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(86)
  • 收藏
  • 关注

转载 HDU6010 Daylight Saving Time

1 /* 2 HDU6010 Daylight Saving Time 3 http://acm.hdu.edu.cn/showproblem.php?pid=6010 4 模拟 5 题意:算当前时间是否是夏令时 6 7 */ 8 #include <cstdio> 9 #include <algori...

2017-03-24 11:57:00 143

转载 HDU5926 Mr. Frog’s Game

1 /* 2 HDU5926 Mr. Frog’s Game 3 http://acm.hdu.edu.cn/showproblem.php?pid=5926 4 杂题水题 5 * 6 */ 7 #include <cstdio> 8 #include <algorithm> 9 using namespace st...

2017-03-24 11:54:00 119

转载 HDU5924 Mr. Frog’s Problem

1 /* 2 HDU5924 Mr. Frog’s Problem 3 http://acm.hdu.edu.cn/showproblem.php?pid=5924 4 数论 5 * 6 */ 7 #include <cstdio> 8 int main() 9 {10 long long a,b;11 ...

2017-03-24 11:52:00 113

转载 HDU5979 Convex

1 /* 2 HDU5979 Convex 3 http://acm.hdu.edu.cn/showproblem.php?pid=5979 4 计算几何 三角形面积公式 5 * 6 * 7 */ 8 #include <cstdio> 9 #include <algorithm>10 #include &lt...

2017-03-24 11:47:00 94

转载 HDU5976 Detachment

1 /* 2 HDU5976 Detachment 3 http://acm.hdu.edu.cn/showproblem.php?pid=5976 4 数论 等差数列 5 * 6 * 7 */ 8 #include <cstdio> 9 #include <algorithm>10 #include <...

2017-03-24 11:45:00 121

转载 HDU3236 Gift Hunting

1 /* 2 HDU3236 Gift Hunting 3 http://acm.hdu.edu.cn/showproblem.php?pid=3236 4 dp 滚动数组 5 * 6 * 7 */ 8 #include <cstdio> 9 #include <algorithm>10 using names...

2017-03-24 11:39:00 116

转载 POJ1061 青蛙的约会

1 /* 2 POJ1061 青蛙的约会 3 http://poj.org/problem?id=1061 4 扩展欧几里得 5 6 原题为求t使得,存在l满足 7 (x+mt)-(y+nt)=cl 8 即求 9 cl+(n-m)t=x-y10 *11 *12 *13 */14 15 ...

2017-03-23 20:27:00 79

转载 UVA10200 Prime Time

1 /* 2 UVA10200 Prime Time 3 https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1141 4 素数 概率论 暴力 5 6 输出的时候加1e-5到1e-14都能...

2017-03-17 17:39:00 212

转载 POJ2960 S-Nim

1 /* 2 POJ2960 S-Nim 3 http://poj.org/problem?id=2960 4 博弈论 SG函数 5 * 6 */ 7 8 #include <cstdio> 9 #include <algorithm>10 #include <cstring>11 using ...

2017-03-17 11:58:00 109

转载 HDU1850 Being a Good Boy in Spring Festival

1 /* 2 HDU1850 Being a Good Boy in Spring Festival 3 http://acm.hdu.edu.cn/showproblem.php?pid=1850 4 博弈论 尼姆博弈 5 6 7 尼姆博弈:异或和为0则先手必败,否则先手必胜 8 * 9 *10 */11 #include...

2017-03-16 19:43:00 87

转载 HDU2516 取石子游戏

1 /* 2 HDU2516 取石子游戏 3 http://acm.hdu.edu.cn/showproblem.php?pid=2516 4 博弈论 斐波那契博弈 5 * 6 * 7 * 8 */ 9 #include <cstdio>10 #include <algorithm>11 #include...

2017-03-16 19:21:00 286

转载 HDU2188 选拔志愿者

1 /* 2 HDU2188 选拔志愿者 3 http://acm.hdu.edu.cn/showproblem.php?pid=2188 4 博弈论 巴什博奕 5 巴什博奕要注意n<=m时是必胜态 6 * 7 * 8 * 9 *10 */11 #include <cstdio>12 int main(...

2017-03-16 11:24:00 124

转载 HDU2149 Public Sale

1 /* 2 HDU2149 Public Sale 3 http://acm.hdu.edu.cn/showproblem.php?pid=2149 4 博弈论 巴什博奕 5 * 6 * 7 * 8 */ 9 10 11 #include <cstdio>12 int main()13 {14 ...

2017-03-16 11:18:00 145

转载 HDU2147 kiki's game

1 /* 2 HDU2147 kiki's game 3 博弈论 巴什博奕 4 http://acm.hdu.edu.cn/showproblem.php?pid=2147 5 题意:在一个n×m的棋盘上,初始棋子放在右上角, 6 先走到左下角的胜 7 打出胜负表: 8 n:必胜态 9 p:必败态10 11 n n n ...

2017-03-16 10:59:00 79

转载 HDU1846 Brave Game

1 /* 2 HDU1846 Brave Game  http://acm.hdu.edu.cn/showproblem.php?pid=1846 3 博弈论 巴什博奕 4 * 5 * 6 * 7 * 8 */ 9 #include <cstdio>10 int main()11 {12 int t;13...

2017-03-16 08:13:00 95

转载 LightOJ1214 Large Division

1 /* 2 LightOJ1214 Large Division 3 http://lightoj.com/login_main.php?url=volume_showproblem.php?problem=1214 4 5 数论 同余定理 6 7 题意:大整数取余 8 * 9 *10 *11 *12 */1...

2017-03-15 20:27:00 105

转载 POJ2480 Longge's problem

1 /* 2 POJ2480 Longge's problem 3 http://poj.org/problem?id=2480 4 数论 欧拉函数 线性筛 5 6 求sigma_i=1^n{gcd(i,n)} 7 <=>sigma_d|n{d*phi(n/d)} 8 * 9 * 10 * 11 ...

2017-03-15 00:36:00 90

转载 HDU 5880 Family View

1 /* 2 HDU 5880 Family View 3 http://acm.hdu.edu.cn/showproblem.php?pid=5880 4 AC自动机 5 注意不要直接全把节点初始化,将其当做内存池来用, 6 用的时候再初始化,否则会MLE 7 */ 8 #include<cstdio> 9 #incl...

2017-03-12 10:54:00 295

转载 LightOJ 1336 Sigma Function

/* LightOJ 1336 Sigma Function http://lightoj.com/login_main.php?url=volume_showproblem.php?problem=1336数论 奇偶性题目求f(n)为偶数的个数我们发现如果f(n)为奇数,则n为x^2,2*x^2,2^x三种形式,因为2^x中已经包含剩下两种,所以只...

2017-03-09 17:25:00 145

转载 POJ 2478 Farey Sequence

/*POJ 2478 Farey Sequencehttp://poj.org/problem?id=2478欧拉函数 线性筛原问题转化成1-n之间的欧拉函数和,因此利用线性筛在O(n)时间内求出其欧拉函数值在求前缀和即可。 * * * */#include <cstdio>#include <algorithm>...

2017-03-09 17:16:00 72

转载 HDU 3037 Saving Beans

/*hdu3037http://acm.hdu.edu.cn/showproblem.php?pid=3037lucas 模板题*/#include <cstdio>#include <cmath>const long long Nmax=100005;long long p;long long ex_gcd(lon...

2017-03-08 20:34:00 59

转载 HDU 2857 Mirror and Light

/* hdu 2857 Mirror and Light计算几何镜面反射*/#include<stdio.h>#include<string.h>#include<math.h>#include<algorithm>using namespace std;const double DNF=1000...

2017-03-08 20:33:00 114

转载 HDU 4869 Turn the pokers

/*HDU4869http://acm.hdu.edu.cn/showproblem.php?pid=4869费马小定理+快速幂 求逆元 暴力组合数奇偶性*/#include <cstdio>#include <algorithm>using namespace std;const __int64 Nmax=100005LL...

2017-03-08 20:31:00 106

转载 HDU 4861 Couple doubi

/*HDU 4861 Couple doubihttp://acm.hdu.edu.cn/showproblem.php?pid=4861 打表找规律 * */#include <cstdio>#include <algorithm>using namespace std;const int Nmax=100005;in...

2017-03-08 20:24:00 108

转载 HDU 4913 Least common multiple

/*hdu4913 Least common multiplehttp://acm.hdu.edu.cn/showproblem.php?pid=4913离散化 线段树 统计逆序数思想tips:1、线段树中一定要到处都取模,否则wa。。。2、lazy是乘积的形式出现,不是加和 */#include <cstdio>#include &l...

2017-03-08 20:20:00 130

转载 HDU 4911 ( Inversion )

/*HDU 4911 ( Inversion ) http://acm.hdu.edu.cn/showproblem.php?pid=4911线段树求逆序数离散化 离散化 离散化!重要的事情说三遍 嘤嘤嘤*/#include <cstdio>#include <algorithm>#include <vector&gt...

2017-03-08 20:19:00 105

转载 BZOJ 1004: [HNOI2008]Cards

/*bzoj 1004: [HNOI2008]Cardshttp://www.lydsy.com/JudgeOnline/problem.php?id=1004burside+dp 置换群 k背包dp求解不动点 burside定理 求逆元*/#include <cstdio>#include <algorithm>using n...

2017-03-08 20:17:00 96

转载 BZOJ 3674 可持久化并查集加强版(路径压缩版本)

/*bzoj 3674: 可持久化并查集加强版http://www.lydsy.com/JudgeOnline/problem.php?id=3674用可持久化线段树维护可持久化数组从而实现可持久化并查集可持久化线段树+并查集+路径压缩+读入优化*/#include <cstdio>#include <algorithm>usi...

2017-03-08 20:16:00 169

转载 BZOJ 3674 可持久化并查集加强版(按秩合并版本)

1 /* 2 bzoj 3674: 可持久化并查集加强版 3 http://www.lydsy.com/JudgeOnline/problem.php?id=3674 4 用可持久化线段树维护可持久化数组从而实现可持久化并查集 5 可持久化线段树+并查集+按秩合并+读入优化 6 */ 7 #include <cstdio> 8...

2017-03-08 20:14:00 137

转载 ZOJ 3609 Modular Inverse

ZOJ 3609 1 #include <cstdio> 2 #include <cmath> 3 using namespace std; 4 int ex_gcd(int a,int b,int &x,int &y)//solve x,y in a*x+b*y=ex_gcd(a,b,x,y)=gcd(a,b); 5 ...

2017-01-16 19:30:00 70

转载 2015 Syrian Private Universities Collegiate Programming Contest 题解

题目在这里>_<发现这场比赛在网上没有完整的题解,甚至连题目代码都没人贴出来(大概是因为题目太水了吧。。。)。所以宝宝就来写个题解,也就当作成长记录了233333A. Window题意很简单,给出n组x,y,求x*y的值 1 #include <cstdio> 2 #include <algorithm> 3 us...

2016-11-01 09:54:00 413

转载 HDU 4262 Juggler

点我看题初步想法是模拟,找到下一个位置并记录操作数,O(n^2)肯定会超时。那么进行优化,会发现到下一位置的操作数就是两个位置之间存在的数的个数,于是就变成了计数问题。不难想到用树状数组或线段树进行计数,时间复杂度O(nlogn)。 1 #include<cstdio> 2 #include<algorithm> 3 #include&...

2016-10-22 01:11:00 93

转载 HDU 5090 Game with Pearls

题目地址二分图最大匹配,将1-n分为二分图的一边,编号1-n为另一边,当编号1-n中的数字加0或k的整数倍为j(j<=n)的时候将编号i与j相连。如此,这个二分图中如果最大匹配数为n,则Jerry赢,否则Tom赢。 1 #include<stdio.h> 2 #include<algorithm> 3 using namespace ...

2016-10-13 01:14:00 113

转载 HDU 1394 Minimum Inversion Number

题目地址强行线段树求逆序数,不要问我为何如此作死2333333,RE了好几发,感觉自己简直智障 1 #include<cstdio> 2 #include<algorithm> 3 #include<vector> 4 using namespace std; 5 const int Nmax=10010; ...

2016-10-11 09:58:00 73

转载 HDU 1698 Just a Hook

题目地址线段树这题看到第一句和插图宝宝我就惊呆了23333 1 #include<cstdio> 2 #include<algorithm> 3 using namespace std; 4 const int Nmax=1e5+10; 5 struct Node 6 { 7 int l; 8 ...

2016-10-11 08:27:00 66

转载 POJ 2104 K-th Number

题目地址主席树+离散化因为主席树空间开小了RE了两次,呜呜呜一定要注意空间大小 1 #include<cstdio> 2 #include<algorithm> 3 #include<vector> 4 using namespace std; 5 const int Nmax=1e5+6; 6 int n,m;...

2016-10-07 12:30:00 65

转载 UVA 1160 - X-Plosives

题目地址并查集 1 #include<cstdio> 2 #include<algorithm> 3 using namespace std; 4 const int Nmax=1e5+10; 5 int f[Nmax]; 6 int a,b; 7 int ans; 8 9 10 void init()11 {...

2016-10-07 01:42:00 144

转载 HDU 5895 Mathematician QSC

题目地址欧拉函数+矩阵快速幂 1 #include<cstdio> 2 #include<algorithm> 3 #include<string.h> 4 #include<queue> 5 #define LL long long 6 using namespace std; 7 con...

2016-10-07 01:28:00 149

转载 HDU 3294 Girls' research

题目地址manacher 1 #include<cstdio> 2 #include<string.h> 3 #include<algorithm> 4 using namespace std; 5 const int Nmax=200005; 6 char s[Nmax]; 7 char str[Nmax*2+10...

2016-10-07 01:24:00 99

转载 HDU 3068 最长回文

题目地址manacher 1 #include<cstdio> 2 #include<algorithm> 3 #include<string.h> 4 using namespace std; 5 const int Nmax=110005; 6 char s[Nmax]; 7 8 struct Manach...

2016-10-07 01:22:00 64

空空如也

空空如也

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

TA关注的人

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