自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

xtulollipop

物质都是数据,规则都是代码。这世间有万千代码,万物都可编译。 Talk is cheap,show me the code。

  • 博客(40)
  • 收藏
  • 关注

原创 codeforces687BRemainders Game+数论

Today Pari and Arya are playing a game called Remainders.Pari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the value . There are n ancient numbers c1, c2, …, cn a

2016-08-31 22:36:28 493

原创 codeforces708BRecover the String+数学构造

For each string s consisting of characters ‘0’ and ‘1’ one can define four integers a00, a01, a10 and a11, where axy is the number of subsequences of length 2 of the string s equal to the sequence {x,

2016-08-31 21:39:25 451

原创 hdu5481Desiderium+区间覆盖次数

Problem Description There is a set of intervals, the size of this set is n.If we select a subset of this set with equal probability, how many the expected length of intervals’ union of this subset is?

2016-08-31 17:58:16 662

原创 hdu5476Explore Track of Point+平面几何

Problem Description In Geometry, the problem of track is very interesting. Because in some cases, the track of point may be beautiful curve. For example, in polar Coordinate system, ρ=cos3θ is like ro

2016-08-31 16:18:48 447

原创 第十二届湖南省赛--三角形和矩形

Bobo 有一个三角形和一个矩形,他想求他们交的面积。 具体地,三角形和矩形由 8 个整数 x1,y1,x2,y2,x3,y3,x4,y4 描述。表示三角形的顶点坐标是 (x1,y1),(x1,y2),(x2,y1),矩形的顶点坐标是 (x3,y3),(x3,y4),(x4,y4),(x4,x3). 输入 输入包含不超过 30000 组数据。 每组数据的第一行包含 4 个整数 x1,y1,x2

2016-08-31 11:45:47 991

原创 第十二届湖南省赛--2016

给出正整数 n 和 m,统计满足以下条件的正整数对 (a, b) 的数量:1 ≤ a ≤ n, 1 ≤ b ≤ m;a × b 是 2016 的倍数。输入包含不超过 30 组数据。每组数据包含两个整数 n, m (1 ≤ n, m ≤ 109 ). Output对于每组数据,输出一个整数表示满足条件的数量。 Sample Input 32 63 2016 2016 100000000

2016-08-31 11:37:09 1071

原创 hdu5451Best Solver=矩阵快速幂+广义斐波拉契

Problem Description The so-called best problem solver can easily solve this problem, with his/her childhood sweetheart.It is known that y=(5+26√)1+2x.y=(5+2\sqrt6)^{1+2^x}. For a given integer x (0≤x

2016-08-31 11:08:29 445

原创 hdu4565So Easy!+矩阵快速幂+广义斐波拉契

Problem Description   A sequence Sn is defined as: Where a, b, n, m are positive integers.┌x┐is the ceil of x. For example, ┌3.14┐=4. You are to calculate Sn.   You, a top coder, say: So easy!Inpu

2016-08-31 11:02:45 594

原创 hdu2256Problem of Precision+矩阵快速幂+广义斐波拉契

Problem DescriptionInput The first line of input gives the number of cases, T. T test cases follow, each on a separate line. Each test case contains one positive integer n. (1 <= n <= 10^9)Output For

2016-08-31 10:53:36 587

原创 知识小点积累

1.循环节f(n)=af(n−1)+bf(n−2),f(1)=c,f(2)=df(n)=af(n-1)+bf(n-2),f(1)=c,f(2)=d f(n)%p循环节:当c是膜p的二次剩余,枚举n=(p-1)的因子,        当c是膜p的非二次剩余,枚举n=(p-1)(p+1)的因子。2.二次剩余d是膜p的二次剩余当且仅当 d(p−1)/2≡1(mod p)d^{(p-1)/2}\equ

2016-08-30 22:50:07 415

原创 NBUT 1640多边形的公共部分+多边形面积交

Description给定两个简单多边形,你的任务是判断二者是否有面积非空的公共部分。如下图,(a)中的两个矩形只有一条公共线段,没有公共面积。 在本题中,简单多边形是指不自交(也不会接触自身)、不含重复顶点并且相邻边不共线的多 边形。 注意:本题并不复杂,但有很多看上去正确的算法实际上暗藏缺陷,请仔细考虑各种情况。 Input 输入包含不超过 100 组数据。每组数据包含两行,每个多边形占一行

2016-08-29 23:37:19 1693 2

原创 poj3130How I Mathematician Wonder What You Are!+半平面交

半平面交

2016-08-26 17:51:00 547

原创 hdu4458Shoot the Airplane+计算几何

Problem Description XXX is playing an interesting game which is based on a 2D plane. In this game, he is required to shoot an airplane. The airplane flies horizontally. The shape of it can be regarded

2016-08-23 21:15:53 510

原创 hdu4454Stealing a Cake+计算几何

Problem Description There is a big round cake on the ground. A small ant plans to steal a small piece of cake. He starts from a certain point, reaches the cake, and then carry the piece back home. He

2016-08-23 21:05:58 399

原创 hdu2823The widest road+两凸包之间的最小距离

Problem Description There were two families in the village — family A and family B, while these two families didn’t get along well with each other. Now the head of the village decided to make a road t

2016-08-23 15:20:50 964 1

原创 poj3608Bridge Across Islands+两凸包最近距离

DescriptionThousands of thousands years ago there was a small kingdom located in the middle of the Pacific Ocean. The territory of the kingdom consists two separated islands. Due to the impact of the o

2016-08-23 15:11:50 334

原创 二维计算几何模板--多边形/凸包

转载请注明出处:http://blog.csdn.net/xtulollipop#include<cstdio>#include<cmath>#include<cstring>#include<iostream>#include<algorithm>#include<cstdlib>#include<queue>#include<map>#include<stack>#includ

2016-08-23 15:03:42 447

原创 UVA10173Smallest Bounding Rectangle+最小矩形覆盖

Given the Cartesian coordinates of n(>0) 2-dimensional points, write a program that computes the area of their smallest bounding rectangle (smallest rectangle containing all the given points). Input

2016-08-22 01:39:01 671

原创 二维计算几何模板--圆

转载请注明出处 http://blog.csdn.net/xtulollipop#include<cstdio>#include<cmath>#include<cstring>#include<iostream>#include<algorithm>#include<cstdlib>#include<queue>#include<vector>#include<map>#inclu

2016-08-21 17:46:55 630

原创 codeforces707Adiv2Brain's Photos+水题

Small, but very brave, mouse Brain was not accepted to summer school of young villains. He was upset and decided to postpone his plans of taking over the world, but to become a photographer instead.As

2016-08-21 02:07:43 474

原创 codeforces707Bdiv2Bakery+贪心

Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connects some pair of cities.To bake muffins in her baker

2016-08-21 02:02:46 768

原创 codeforces707Cdiv2Pythagorean Triples+勾股数

Problem Description When ?? was born, seven crows flew in and stopped beside him. In its childhood, ?? had been unfortunately fall into the sea. While it was dying, seven dolphins arched its body and

2016-08-21 01:55:52 413

原创 poj3528Ultimate Weapon+三维凸包的表面积

DescriptionIn year 2008 of the Cosmic Calendar, the Aliens send a huge armada towards the Earth seeking after conquest. The humans now depend on their ultimate weapon to retain their last hope of survi

2016-08-20 16:55:38 638

原创 hdu3662 +3D Convex Hull+三维凸包的表面多边形个数

Description There are N points in 3D-space which make up a 3D-Convex hull*. How many faces does the 3D-convexhull have? It is guaranteed that all the points are not in the same plane.In case you don’t

2016-08-20 16:54:00 1017 1

原创 hud4273--poj3862+三维凸包模板题+凸包重心到表面的最小距离

Description I work at NASA outer space rescue team which needs much courage and patient. In daily life, I always receive a lot of mission, and I must complete it right now. Today, team leader announc

2016-08-20 16:42:47 506

原创 二维计算几何模板(点,线)

#include<cstdio>#include<cmath>#include<cstring>#include<iostream>#include<algorithm>#include<cstdlib>#include<queue>#include<vector>#include<map>#include<stack>#include<set>#define e exp(1.

2016-08-20 14:35:48 643

原创 hdu5858Hard problem+计算几何(圆的面积交)

Problem Description cjj is fun with math problem. One day he found a Olympic Mathematics problem for primary school students. It is too difficult for cjj. Can you solve it? Give you the side length o

2016-08-18 21:59:31 739

原创 poj3304Segments+计算几何(二维几何模板)

DescriptionGiven n segments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on it, all projected segments have at least

2016-08-18 21:48:15 578

原创 hdu5810Balls and Boxes+数学期望

Problem Description Mr. Chopsticks is interested in random phenomena, and he conducts an experiment to study randomness. In the experiment, he throws n balls into m boxes in such a manner that each ba

2016-08-16 21:18:11 404

转载 三维凸包模板

今天遇到了个3维凸包问题的题,网上找了2个模板。。感谢菊苣们。。不要嫌弃我转载一下下啊。。。orz/*给出三维空间中的n个顶点,求解由这n个顶点构成的凸包表面的多边形个数.增量法求解:首先任选4个点形成的一个四面体,然后每次新加一个点,分两种情况: 1> 在凸包内,则可以跳过 2> 在凸包外,找到从这个点可以"看见"的面,删除这些面,然后对于一边没有面

2016-08-16 20:29:07 2190

原创 hdu5839Special Tetrahedron+几何计算

Problem Description Given n points which are in three-dimensional space(without repetition).Please find out how many distinct Special Tetrahedron among them. A tetrahedron is called Special Tetrahedro

2016-08-15 21:46:25 385

原创 codeforces549CThe Game Of Parity+博弈

There are n cities in Westeros. The i-th city is inhabited by ai people. Daenerys and Stannis play the following game: in one single move, a player chooses a certain town and burns it to the ground. Th

2016-08-15 18:06:53 413

原创 codeforces594A/616B+博弈(最大值最小)

output standard outputIn the official contest this problem has a different statement, for which jury’s solution was working incorrectly, and for this reason it was excluded from the contest. This mist

2016-08-15 16:01:24 687

原创 codeforces603CLieges of Legendre+SG博弈

Kevin and Nicky Sun have invented a new game called Lieges of Legendre. In this game, two players take turns modifying the game state with Kevin moving first. Initially, the game is set up so that ther

2016-08-12 22:22:28 339

原创 hdu5800To My Girlfriend+DP

Problem Description Dear GuoI never forget the moment I met with you.You carefully asked me: “I have a very difficult problem. Can you teach me?”.I replied with a smile, “of course”.”I have n items, t

2016-08-06 16:48:45 435

原创 hdu5795A Simple Nim/hihoCoder1173+SG博弈

Problem Description Two players take turns picking candies from n heaps,the player who picks the last one will win the game.On each turn they can pick any number of candies which come from the same he

2016-08-05 15:50:12 523

原创 hdu5781ATM Mechine+数学期望

Problem Description Alice is going to take all her savings out of the ATM(Automatic Teller Machine). Alice forget how many deposit she has, and this strange ATM doesn’t support query deposit. The only

2016-08-03 14:46:22 374

原创 hduThe All-purpose Zero+LIS

啊啊喔。啊啊哦。好久没DP,没DP,不会了啊,不会了啊。orz(以防万一,膜拜边上的两位菊苣)。。LIS:以前写的都是O(n2n^2)的复杂度。今弃嫌。换一nlog(n)nlog(n) 的写法。调试几小时,O啦。 严格递增/非严格递增int LIS(int A[],int n){ memset(d,0,sizeof(d)); memset(g,INF,sizeof(g));

2016-08-01 20:11:36 305

原创 hdu5171GTY's birthday gift+递推+矩阵快速幂

转载请注明出处:http://blog.csdn.net/xtulollipop Problem Description FFZ’s birthday is coming. GTY wants to give a gift to ZZF. He asked his gay friends what he should give to ZZF. One of them said, ‘Nothing

2016-08-01 16:36:09 461

原创 将递推式转换成矩阵优化

对于很多递推式取膜,在很大的数据的时候,直接递推其实效率并不高。如何将递推式与矩阵练习起来进行优化呢? 比如斐波拉契数列fn=fn−1+fn−2f_n=f_{n-1}+f_{n-2} 我们可以将最终态写成一个一行n列的矩阵|fn fn−1f_n  f_{n-1}| 再将前一种状态也写出来作为等号右边的矩阵|fn−1 fn−2f_{n-1}  f_{n-2}| 所以我们可以构造一个矩阵使得

2016-08-01 10:13:45 2064

空空如也

空空如也

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

TA关注的人

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