自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

代码改变世界

今日的我要超越昨日的我,明日的我要胜过今日的我;以创作出更好的代码为目标,不断地超越自己。

  • 博客(665)
  • 问答 (1)
  • 收藏
  • 关注

原创 Codeforces 148D. Bag of mice(概率DP)

传送门The dragon and the princess are arguing about what to do on the New Year’s Eve. The dragon suggests flying to the mountains to watch fairies dancing in the moonlight, while the princess thinks they

2017-09-03 18:23:18 573

原创 POJ 2151 Check the difficulty of problems(概率DP)

传送门 Organizing a programming contest is not an easy job. To avoid making the problems too difficult, the organizer usually expect the contest result satisfy the following two terms: 1. All of the te

2017-09-03 15:44:50 670

原创 ZOJ 3329 One Person Game——(概率DP+待定系数求解方程)

传送门 There is a very simple and interesting one-person game. You have 3 dice, namely Die1, Die2 and Die3. Die1 has K1 faces. Die2 has K2 faces. Die3 has K3 faces. All the dice are fair dice, so

2017-09-01 18:10:22 731

原创 ZOJ 3203 Light Bulb——(三分求极值)

传送门 Compared to wildleopard’s wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb in his house. Every night, he is wandering in his incommodio

2017-08-29 19:22:52 625

原创 POJ 3301 Texas Trip(最小正方形覆盖+三分)

传送门 After a day trip with his friend Dick, Harry noticed a strange pattern of tiny holes in the door of his SUV. The local American Tire store sells fiberglass patching material only in square sheets.

2017-08-28 19:59:02 1052

原创 POJ 2429 GCD & LCM Inverse(大整数素因子分解+二进制枚举)

GCD & LCM InverseTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 16540Accepted: 3061DescriptionGiven two positive integers a and b, we can easily calculate the greatest common divisor (GCD) an

2017-08-27 20:19:09 1263 2

原创 HDU 6134 Battlestation Operational(基本数论+莫比乌斯反演)——2017 Multi-University Training Contest - Team 8

传送门Battlestation OperationalTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 570    Accepted Submission(s): 317Problem Description > The Death Sta

2017-08-27 14:10:38 823

原创 HDU 6172 Array Challenge(打表+矩阵快速幂)——2017 Multi-University Training Contest - Team 10

传送门 Array ChallengeTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 153428/153428 K (Java/Others)Total Submission(s): 203    Accepted Submission(s): 91Problem Description There’s an array that

2017-08-25 10:21:47 350

原创 HDU 6128 Inverse of sum(数论)——2017 Multi-University Training Contest - Team 7

传送门 Inverse of sumTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 326    Accepted Submission(s): 112Problem Description There are nn nonnegati

2017-08-16 20:59:06 1277 2

原创 HDU 6127 Hard challenge(思维+计算几何)——2017 Multi-University Training Contest - Team 7

传送门Just do itTime Limit: 5000/2500 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 851    Accepted Submission(s): 485Problem Description There is a nonnegative integ

2017-08-16 16:10:35 351

原创 BZOJ 3884: 上帝与集合的正确用法(欧拉函数)——有趣的题目

传送门3884: 上帝与集合的正确用法Time Limit: 5 Sec  Memory Limit: 128 MBSubmit: 2439  Solved: 1079[Submit][Status][Discuss]Description根据一些书上的记载,上帝的一次失败的创世经历是这样的:第一天, 上帝创造了一个世界的基本元素,称做“元”。第二天, 上帝创造了一个新的元素,称作“α”。

2017-08-14 13:53:37 363

原创 HDU 2298 Toxophily(三分+二分)

传送门 Toxophily Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2304    Accepted Submission(s): 1270Problem Description The recreation center of W

2017-08-11 20:17:08 816

原创 HDU 6093 Rikka with Number(java大数+思维)

传送门 Rikka with NumberTime Limit: 8000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 79    Accepted Submission(s): 18Problem Description As we know, Rikka is po

2017-08-08 20:44:37 1178

原创 HDU 6061 RXD and functions(NTT+卷积)

传送门 RXD and functionsTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 532    Accepted Submission(s): 211Problem Description RXD has a polynomia

2017-08-04 12:07:23 1087

原创 HDU 6069 Counting Divisors(素数筛法+枚举+技巧)——2017 Multi-University Training Contest - Team 4

传送门 Counting DivisorsTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 741    Accepted Submission(s): 248Problem Description In mathematics, th

2017-08-03 20:34:11 1675 2

原创 HDU 6048 Puzzle(找规律)——2017 Multi-University Training Contest - Team 2

传送门 PuzzleTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 405    Accepted Submission(s): 216Problem Description A Jigsaw puzzle contains N*M-1

2017-07-31 19:03:55 651

原创 HDU 6053 TrickGCD(分块+容斥)——2017 Multi-University Training Contest - Team 2

传送门 TrickGCDTime Limit: 5000/2500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2177    Accepted Submission(s): 842Problem Description You are given an array AA ,

2017-07-30 11:28:14 646

原创 HDU 6050 Funny Function(构造矩阵+推公式)——2017 Multi-University Training Contest - Team 2

传送门 Funny FunctionTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 724    Accepted Submission(s): 343Problem Description Function Fx,yF_{x,y}sati

2017-07-28 16:07:18 898

原创 HDU 6055 Regular polygon(计算几何+思维)——2017 Multi-University Training Contest - Team 2

传送门 Regular polygonTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1187    Accepted Submission(s): 461Problem Description On a two-dimensional p

2017-07-28 11:26:10 907

原创 HDU 6038 Function(找规律)——2017 Multi-University Training Contest - Team 1

传送门 FunctionTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1034    Accepted Submission(s): 464Problem Description You are given a permutation

2017-07-26 17:51:09 906

原创 FOJ Problem 2283 Tic-Tac-Toe(暴力枚举)——第八届福建省大学生程序设计竞赛-重现赛

传送门 Kim likes to play Tic-Tac-Toe.Given a current state, and now Kim is going to take his next move. Please tell Kim if he can win the game in next 2 moves if both player are clever enough.Here “next

2017-07-24 19:41:01 1315

原创 玲珑杯 1143 - 计算几何你瞎暴力(暴力+YY)——“玲珑杯”ACM比赛 Round #18

1143 - 计算几何你瞎暴力Time Limit:5s Memory Limit:256MByteSubmissions:1828Solved:365DESCRIPTION今天HHHH考完了期末考试,他在教学楼里闲逛,他看着教学楼里一间间的教室,于是开始思考:如果从一个坐标为 (x1,y1,z1)(x1,y1,z1)的教室走到(x2

2017-07-17 19:35:29 424

原创 玲珑杯 1144 - 数论你还会快速幂(打表找规律)

传送门解题思路:官方题解:B. 数论你还会快速幂看到nn比pp大了不到100个,我们可以思考一下假如我们只算到pp或者p−1p-1会是怎么样的即考虑函数∑p−1i=1ik mod p\sum_{i=1}^{p-1}i^k\ mod \ p我们先打个表能发现当kk是p−1p-1的倍数的时候这个值是p−1p-1,别的时候都是00然而这是否正确的呢? 我们可以简单的推导一下:假设gg是pp的原根,那么根据

2017-07-17 19:34:34 975

原创 ZOJ 3829 Known Notation(模拟+YY)——The 2014 ACM-ICPC Asia Mudanjiang Regional Cont

传送门Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It is also known as postfix notation since every operator in an expression follows

2017-07-11 21:11:01 755

原创 HDU 5531 Rebuild(三分)——2015ACM/ICPC亚洲区长春站

传送门 RebuildTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2483    Accepted Submission(s): 548Problem Description Archaeologists find ruins of

2017-07-08 18:13:52 1194

原创 51NOD 1806 wangyurzee的树(容斥原理 + 组合数学)

传送门 wangyurzee有n个各不相同的节点,编号从1到n。wangyurzee想在它们之间连n-1条边,从而使它们成为一棵树。 可是wangyurzee发现方案数太多了,于是他又给出了m个限制条件,其中第i个限制条件限制了编号为u[i]的节点的度数不能为d[i]。 一个节点的度数,就是指和该节点相关联的边的条数。 这样一来,方案数就减少了,问题也就变得容易了,现在请你告诉wangyur

2017-06-29 17:46:05 892 7

原创 求 [1,n-1]中 与 n 的 GCD 值的和

如何求 ∑n−1i=1gcd(i,n)——(1)\sum_{i=1}^{n-1}gcd(i, n)——(1) 因为 gcd(i,n)gcd(i,n) 的值一定是 nn 的因子,然后我们通过观察发现 (1)(1) 式可以写成如下形式: ∑d∗phi(nd),d∈{n的因子},去掉d是n的情况\sum d*phi(\frac n d),d\in \{n的因子\},去掉d是n的情况,其中phi(i):

2017-06-27 18:14:31 765

原创 HDU 5514 Collision(扩展欧几里得+解方程)——2014ACM/ICPC亚洲区北京站

传送门 Matt is playing a naive computer game with his deeply loved pure girl. The playground is a rectangle with walls around. Two balls are put in different positions inside the rectangle. The bal

2017-06-26 18:45:09 715

原创 HDU - 5120 Intersection(简单几何)——2014ACM/ICPC亚洲区北京站

传送门 Matt is a big fan of logo design. Recently he falls in love with logo made up by rings. The following figures are some famous examples you may know. A ring is a 2-D figure bounded by two circl

2017-06-25 20:53:50 883

原创 HDU 5572 An Easy Physics Problem(计算几何)——2015ACM/ICPC亚洲区上海站-重现赛

传送门 An Easy Physics ProblemTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2322    Accepted Submission(s): 469Problem Description On an infinite

2017-06-18 20:01:46 1261

原创 Poj 2689 Prime Distance(素数筛+二次素数筛)

传送门The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of years is the question of prima

2017-06-16 11:57:27 510

原创 NTT(快速数论变换)模板

例题: HDU 1402#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>#include <cmath>using namespace std;const double PI = acos(-1.0);typedef long long LL;const LL MAXN = (1LL<<1

2017-06-14 12:53:39 902

原创 HDU 5514 Frogs(欧拉函数+数论YY)

传送门 FrogsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2198Accepted Submission(s): 714Problem Description There are mm stones lying on a c

2017-06-12 12:37:20 3439 7

原创 51NOD 1678 lyk与gcd(容斥+素数筛)

传送门 这天,lyk又和gcd杠上了。 它拥有一个n个数的数列,它想实现两种操作。1:将 aia_i 改为 bb。 2:给定一个数i,求所有 gcd(i,j)=1gcd(i,j)=1 时的 aja_j 的总和。Input 第一行两个数n,Q(1<=n,Q<=100000)。 接下来一行n个数表示ai(1<=ai<=10^4)。 接下来Q行,每行先读入一个数A(1<=A<=2)。

2017-06-11 21:13:48 832

原创 51NOD 1341 混合序列(构造矩阵)

传送门 题目描述: Input共1行,4个整数数p, q, r, n中间用空格分隔(1 <= p, q, r, n<=1000000000)。Output对于每一个数据,在一行中输出答案。Input示例2 2 1 1Output示例3解题思路:令 f(n)=∑ni=0ai∗bn−if(n)=\sum_{i=0}^na_i*b_{n-i},将其展开有: f(n)=a0∗bn+a1∗bn−1+..

2017-06-07 10:55:06 779

原创 计蒜客47——圈果树(二维凸包)

传送门 小马承包了一个果园,想修一个围栏,但是不希望砍掉任何的果树。对于给出的所有的果树的坐标,计算一下最小的围住所有的果树的围栏的长度。输入数据的第一行包括一个整数 N(0≤ N ≤10,000)表示农夫约翰想要围住的放牧点的数目。接下来 N 行,每行由两个由空格分隔的实数组成,Xi 和 Yi,对应平面上的放牧点坐标(-1,000,000 ≤

2017-06-06 19:11:31 633

原创 HDU 5953 Game of Taking Stones(威佐夫博弈+高精度+二分)——The 2016 ACM-ICPC Asia Dalian Regional Contest

传送门 Two people face two piles of stones and make a game. They take turns to take stones. As game rules, there are two different methods of taking stones: One scheme is that you can take any number of

2017-06-04 15:50:26 1731

原创 HDU 4572 Bottles Arrangement(数学推公式)——2013 ACM-ICPC长沙赛区全国邀请赛

传送门 Bottles ArrangementTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 746    Accepted Submission(s): 565Problem Description   Hunan cuisine is

2017-06-02 21:11:26 1062

原创 玲珑杯 1131 - 喵哈哈村的几何大师╰☆莣メ誋こ月(三角函数)

传送门1131 - 喵哈哈村的几何大师╰☆莣メ誋こ月Time Limit:1s Memory Limit:256MByteSubmissions:280Solved:60DESCRIPTION╰☆莣メ誋こ月是月大叔的ID,他是一个掌握着429种几何画法的的几何大师,最擅长的技能就是搞事,今天他又要开始搞事了。给

2017-05-31 15:11:55 846

原创 HDU 4569 Special equations(思维)——2013 ACM-ICPC长沙赛区全国邀请赛

Let f(x) = anxn +…+ a1x +a0, in which ai (0 <= i <= n) are all known integers. We call f(x) 0 (mod m) congruence equation. If m is a composite, we can factor m into powers of primes and solve every s

2017-05-28 18:35:27 988

空空如也

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

TA关注的人

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