自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

SSimpLe_Y的博客

人一我百,人十我万,然而我做不到。

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

原创 bzoj 2005 能量采集(莫比乌斯反演)

Description栋栋有一块长方形的地,他在地上种了一种能量植物,这种植物可以采集太阳光的能量。在这些植物采集能量后,栋栋再使用一个能量汇集机器把这些植物采集到的能量汇集到一起。 栋栋的植物种得非常整齐,一共有n列,每列有m棵,植物的横竖间距都一样,因此对于每一棵植物,栋栋可以用一个坐标(x, y)来表示,其中x的范围是1至n,表示是在第x列,y的范围是1至m,表示是在第x

2017-08-15 10:38:18 871

原创 bzoj 2818 Gcd(莫比乌斯反演)

Description给定整数N,求1数对(x,y)有多少对.Input一个整数NOutput如题Sample Input4Sample Output4HINThint对于样例(2,2),(2,4),(3,3),(4,2)1裸莫比乌斯反演。设F(n) 为gcd是n

2017-08-15 10:29:51 896

原创 hdu 6053 TrickGCD(莫比乌斯反演)

Problem DescriptionYou are given an array A , and Zhu wants to know there are how many different array B satisfy the following conditions?* 1≤Bi≤Ai* For each pair( l , r ) (1≤l≤r≤n) ,

2017-08-14 20:45:57 830

原创 2017"百度之星"程序设计大赛 - 初赛(B)(HDU6115) 1002 Factory(LCA)

Problem Description我们将A省简化为由N个城市组成,某些城市之间存在双向道路,而且A省的交通有一个特点就是任意两个城市之间都能通过道路相互到达,且在不重复经过城市的情况下任意两个城市之间的到达方案都是唯一的。聪明的你一定已经发现,这些城市构成了树这样一个结构。现在百度陆续开了许许多多的子公司。每家子公司又会在各城市中不断兴建属于该子公司的办公室。由于各个子公司之间

2017-08-14 17:28:20 1066

原创 hdu 1695 GCD(莫比乌斯反演)

Problem DescriptionGiven 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y. Since the number of choices ma

2017-08-14 16:59:05 833

原创 UVA 12298 Super Poker II(FFT)

题目链接:点击打开链接I have a set of super poker cards, consisting of an infinite number of cards. For each positive compositeinteger p, there are exactly four cards whose value is p: Spade(S), Heart(H), Cl

2017-08-07 17:39:44 742

原创 hdu 4609 3-idiots(FFT)

Problem DescriptionKing OMeGa catched three men who had been streaking in the street. Looking as idiots though, the three men insisted that it was a kind of performance art, and begged the king to

2017-08-07 14:54:11 569

原创 UVALive 6886 Golf Bot (FFT)

题目链接 : 点击打开链接Do you like golf? I hate it. I hate golf so much that Idecided to build the ultimate golf robot, a robot thatwill never miss a shot. I simply place it over the ball,choose the rig

2017-08-07 10:44:41 800

原创 hdu 1402 A * B Problem Plus(FFT-大整数乘法)

Problem DescriptionCalculate A * B. InputEach line will contain two integers A and B. Process to end of file.Note: the length of each integer will not exceed 50000.

2017-08-07 10:28:16 741

原创 POJ 3150/ UVA 1386 Cellular Automaton(矩阵乘法&循环矩阵)

DescriptionA cellular automaton is a collection of cells on a grid of specified shape that evolves through a number of discrete time steps according to a set of rules that describe the new state

2017-08-05 16:13:11 758

原创 hdu 2256 Problem 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

2017-08-03 11:55:28 1688

原创 hdu 4565 So 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! Input

2017-08-03 10:57:26 1539

原创 UVA 10655 Contemplation! Algebra(矩阵乘法)

题意:求an+bna^n + b^n。 输入三个数,p,q,n p = a+b; q = a*b; n不用说了。可以把前几项列出来 a0+b0=2a^0 + b^0 = 2; a1+b1=a+ba^1 + b^1 = a+b; a2+b2=(a+b)∗(a+b)−2∗a∗ba^2 + b^2 = (a+b)*(a+b) - 2*a*b a3+b3=(a2+b2)∗(a+b)−(a2+

2017-08-02 18:36:34 963

原创 UVA 11149 - Power of Matrix(矩阵乘法)

求矩阵幂次的和 就是让求:A1+A2+A3+⋯+An A^1 + A^2 + A^3 + \cdots + A^n 如果我们一个一个求A的幂次,再加起来,算一下复杂度,肯定会超时。 我们可以转化一下: 原式 = A1+A2+⋯+An/2+An/2∗(A1+A2+⋯+An/2)A^1 + A^2 + \cdots + A^{n/2} + A^{n/2}*(A^1 + A^2 + \cdots

2017-08-02 16:04:58 961

原创 2017 Multi-University Training Contest 3( hdu 6060) RXD and dividing

Problem DescriptionRXD has a tree T, with the size of n. Each edge has a cost.Define f(S) as the the cost of the minimal Steiner Tree of the set S on tree T. he wants to divide 2,3,4,5

2017-08-02 10:35:42 873

原创 Codeforces Round #426 (Div. 2) D. The Bakery(DP+线段树)

Some time ago Slastyona the Sweetmaid decided to open her own bakery! She bought required ingredients and a wonder-oven which can bake several types of cakes, and opened the bakery.Soon the expens

2017-07-31 09:16:44 1759

原创 hdu 4965 Fast Matrix Calculation(矩阵乘法)

Problem DescriptionOne day, Alice and Bob felt bored again, Bob knows Alice is a girl who loves math and is just learning something about matrix, so he decided to make a crazy problem for her.

2017-07-30 16:06:27 798

原创 hdu 4549 M斐波那契数列(矩阵乘法+降幂公式)

Problem DescriptionM斐波那契数列F[n]是一种整数数列,它的定义如下:F[0] = aF[1] = bF[n] = F[n-1] * F[n-2] ( n > 1 )现在给出a, b, n,你能求出F[n]的值吗? Input输入包含多组测试数据;每组数据占一行,包含3个整数a, b, n( 0

2017-07-30 13:18:21 1142

原创 hdu 4990 Reading comprehension(矩阵乘法)

Problem DescriptionRead the program below carefully then answer the question.#pragma comment(linker, "/STACK:1024000000,1024000000")#include #include#include #include #include #inclu

2017-07-29 20:45:22 809

原创 hdu 5015 - 233 Matrix(矩阵乘法)

Problem DescriptionIn our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 ... in the same meaning. And here is the question: Suppose we have a matr

2017-07-29 20:34:34 831

原创 poj 2774 Long Long Message(后缀数组)

DescriptionThe little cat is majoring in physics in the capital of Byterland. A piece of sad news comes to him these days: his mother is getting ill. Being worried about spending so much on railwa

2017-07-29 11:53:38 879

原创 poj 1743 Musical Theme(后缀数组)

DescriptionA musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It is unfortunate but true that this re

2017-07-27 10:06:02 783

原创 poj 3261 Milk Patterns(后缀数组-最长重复子串)

DescriptionFarmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he discovered that although he can't predict the quality of milk fro

2017-07-26 18:26:11 935

原创 SPOJ New Distinct Substrings(后缀数组)

Given a string, we need to find the total number of its distinct substrings.InputT- number of test cases. TOutputFor each test case output one number saying the number of distinct subs

2017-07-26 18:00:52 847

原创 bzoj 1016: [JSOI2008]最小生成树计数

Description  现在给出了一个简单无向加权图。你不满足于求出这个图的最小生成树,而希望知道这个图中有多少个不同的最小生成树。(如果两颗最小生成树中至少有一条边不同,则这两个最小生成树就是不同的)。由于不同的最小生成树可能很多,所以你只需要输出方案数对31011的模就可以了。Input  第一行包含两个数,n和m,其中1数编号。接下来的m行,每行包含两个

2017-07-23 13:41:20 784

原创 1013: [JSOI2008]球形空间产生器sphere(高斯消元)

Description  有一个球形空间产生器能够在n维空间中产生一个坚硬的球体。现在,你被困在了这个n维球体中,你只知道球面上n+1个点的坐标,你需要以最快的速度确定这个n维球体的球心坐标,以便于摧毁这个球形空间产生器。Input  第一行是一个整数n(1后6位,且其绝对值都不超过20000。Output  有且只有一行,依次给出球心的n维坐标(n

2017-07-22 17:08:15 836

原创 bzoj 1012: [JSOI2008]最大数maxnumber(树状数组)

Description  现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。2、 插入操作。语法:A n 功能:将n加上t,其中t是最近一次查询操作的答案(如果还未执行过查询操作,则t=0),并将所得结果对一个固定的常数D取模,将所得答案插入到数列的末尾。限制:

2017-07-22 14:19:14 1094

原创 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-01 produces exactly p new deadly Bacteria where x =

2017-07-01 15:13:04 875

原创 lightoj 1282 - Leading and Trailing

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.InputInput starts with an integer T (≤ 1000), denoting the num

2017-06-30 20:14:53 1354

原创 lightoj 1138 - Trailing Zeroes (III)(N的阶层后有多少个零+二分)

You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*...*N. For example, 5! = 120, 120 contains one zero on the t

2017-06-29 19:08:42 887

原创 lightoj 1336 - Sigma Function(算数基本定理)

Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes the sum of all divisors of a number. For example σ(24) = 1+2+3+4

2017-06-27 17:04:47 1319

原创 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 his students, so he asked his assistant Bi-Shoe to go

2017-06-26 17:56:22 813

原创 poj 2187 Beauty Contest(凸包)

DescriptionBessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make a tour of N (2 <= N <= 50,000) fa

2017-06-25 21:51:27 830

原创 POJ 1584 A Round Peg in a Ground Hole(判断凸多边形,判断圆是否在凸多边形内)

DescriptionThe DIY Furniture company specializes in assemble-it-yourself furniture kits. Typically, the pieces of wood are attached to one another using a wooden peg that fits into pre-cut holes i

2017-06-25 21:06:28 859

原创 POJ 3449 Geometric Shapes

DescriptionWhile creating a customer logo, ACM uses graphical utilities to draw a picture that can later be cut into special fluorescent materials. To ensure proper processing, the shapes in the p

2017-06-25 17:06:45 773

原创 poj 2653 Pick-up sticks(判断线段相交)

DescriptionStan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks, that is these sticks such th

2017-06-21 14:03:30 937

原创 POJ 1269 Intersecting Lines(判断两条直线的位置关系)

DescriptionWe all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection because they are paralle

2017-06-20 20:26:52 902

原创 POJ 2318 TOYS(叉积判断点与线段的位置关系)

DescriptionCalculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away when he is finished playing with th

2017-06-20 16:30:00 1179

原创 2017年第八届蓝桥杯C/C++B组决赛题解

一、36进制对于16进制,我们使用字母A-F来表示10及以上的数字。如法炮制,一直用到字母Z,就可以表示36进制。36进制中,A表示10,Z表示35,AA表示370你能算出 MANY 表示的数字用10进制表示是多少吗?请提交一个整数,不要填写任何多余的内容(比如,说明文字)答案:1040254直接笔算都能算出来,写个程序也很简单,就不贴代码了。二、磁砖样

2017-06-01 15:16:44 4139 2

原创 长度不超过m的最大连续子序列(dp + 单调队列)

给你n个数,然后让你求最大连续子序列的和,限制条件是连续子序列的长度不超过m。n,m  就是让你找到一个长度不超过m的区间,区间和最大。普通的dp转移方程就是 dp[i] = sum[i] - min(sum[j] | i- m 但是这样的复杂度最坏会达到n^2,所以得优化,就用到了单调队列。针对这题来说一下什么是单调队列,这题我们需要存下距离不超过m,且最小的前缀和的下标。

2017-05-13 12:11:51 7294

空空如也

空空如也

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

TA关注的人

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