自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Coldfresh的博客

keeeeeep!~

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

原创 Ignatius's puzzle HDU - 1098 (中国剩余+扩欧)

Ignatius is poor at math,he falls across a puzzle problem,so he has no choice but to appeal to Eddy. this problem describes that:f(x)=5*x^13+13*x^5+k*a*x,input a nonegative integer k(k<10000),to find t

2017-09-30 22:24:32 357

原创 GCD and LCM HDU - 4497 (唯一分解定理)

Given two positive integers G and L, could you tell me how many solutions of (x, y, z) there are, satisfying that gcd(x, y, z) = G and lcm(x, y, z) = L? Note, gcd(x, y, z) means the greatest common d

2017-09-30 20:18:18 533

原创 Harry Potter and the Hide Story HDU - 3988 (数论)

iSea is tired of writing the story of Harry Potter, so, lucky you, solving the following problem is enough. Input The first line contains a single integer T, indicating the number of test cases. E

2017-09-30 17:44:25 334

原创 Special Prime HDU - 2866(数论)

Give you a prime number p, if you could find some natural number (0 is not inclusive) n and m, satisfy the following expression: We call this p a “Special Prime”. AekdyCoin want you to tell him the

2017-09-30 16:00:44 439

原创 GCD HDU - 2588(欧拉函数)

The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b,For example,(1,2)=1,(12,18)=6. (a,b) can be easily found by the

2017-09-29 23:20:00 449

原创 Conquer a New Region HDU - 4424(带权并查集的dp)

The wheel of the history rolling forward, our king conquered a new region in a distant continent. There are N towns (numbered from 1 to N) in this region connected by several roads. It’s confirmed th

2017-09-29 21:51:53 376

原创 Sticks and Right Triangle HDU - 3939(毕达哥拉斯)

We have a stick with infinite length. Now we want to cut 3 sub-sticks with length x, y, z which is not large than L to form a right triangle. With unknown reasons we assume that x, y, z are all integer

2017-09-29 19:08:53 312

原创 Pocket Cube HDU - 4801 (dfs)

Pocket Cube is a 3-D combination puzzle. It is a 2 × 2 × 2 cube, which means it is constructed by 8 mini-cubes. For a combination of 2 × 2 mini-cubes which sharing a whole cube face, you can twist it 9

2017-09-29 15:15:00 329

原创 Infinite Inversions CodeForces - 540E (树状数组+离散化)

题目链接 题目大意,在一串无穷的1,2,3…n的串值,有k次操作,每次操作给出两个数a,b,即把坐标a和坐标b的值交换,问最后有多少个逆序对,0<=k<=105,a和b在int范围内0<=k<=10^5,a和b在int范围内 分析:问题的关键是,操作次数相对与整个序列是比较稀疏的,也就是说会有许多连续的数串 ,我们就是把这些连续的数串缩微一个点,而点的权值即为这个数串的数量,用离散化来处理,最后

2017-09-29 13:05:59 378

原创 Prime Distance POJ - 2689 (素数)

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 primalit

2017-09-27 14:46:31 313

原创 Zball in Tina Town HDU - 5391 (威尔逊定理)

Tina Town is a friendly place. People there care about each other. Tina has a ball called zball. Zball is magic. It grows larger every day. On the first day, it becomes 1 time as large as its original

2017-09-26 14:28:12 340

原创 YAPTCHA HDU - 2973 (威尔逊定理)

The math department has been having problems lately. Due to immense amount of unsolicited automated programs which were crawling across their pages, they decided to put Yet-Another-Public-Turing-Test-t

2017-09-26 14:03:25 344

原创 Squarefree number HDU - 3826(数论)

In mathematics, a squarefree number is one which is divisible by no perfect squares, except 1. For example, 10 is square-free but 18 is not, as it is divisible by 9 = 3^2. Now you need to determine whe

2017-09-25 13:10:43 578

原创 Travel HDU - 5441 (带权并查集+离线)

Jack likes to travel around the world, but he doesn’t like to wait. Now, he is traveling in the Undirected Kingdom. There are nn cities and mm bidirectional roads connecting the cities. Jack hates wait

2017-09-22 14:28:47 343

原创 Car HDU - 5935(???)

Ruins is driving a car to participating in a programming contest. As on a very tight schedule, he will drive the car without any slow down, so the speed of the car is non-decrease real number. Of cours

2017-09-22 00:11:02 442

原创 How Many Maos Does the Guanxi Worth HDU - 5137 (spfa)

“Guanxi” is a very important word in Chinese. It kind of means “relationship” or “contact”. Guanxi can be based on friendship, but also can be built on money. So Chinese often say “I don’t have one mao

2017-09-21 23:19:40 257

原创 Ponds HDU - 5438 (拓扑排序)

Betty owns a lot of ponds, some of them are connected with other ponds by pipes, and there will not be more than one pipe between two ponds. Each pond has a value vv. Now Betty wants to remove some pon

2017-09-21 23:15:00 290

原创 A Bug's Life HDU - 1829 (并查集)

Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gend

2017-09-21 17:37:55 314

原创 Unknown Treasure HDU - 5446 (Lucas定理+CRT)

On the way to the next secret treasure hiding place, the mathematician discovered a cave unknown to the map. The mathematician entered the cave because it is there. Somewhere deep in the cave, she foun

2017-09-21 16:49:37 297

原创 Bomb HDU - 5934(tarjan)

There are N bombs needing exploding. Each bomb has three attributes: exploding radius riri, position (xi,yi)(xi,yi) and lighting-cost cici which means you need to pay cici cost making it explode. If a

2017-09-20 17:57:44 342

原创 GCD HDU - 5726 (ST算法+二分)

Give you a sequence of N(N≤100,000)integers : a1,…,an(0#include<cstdio>#include<iostream>#include<queue>#include<cstring>#include<vector>#include<algorithm>#include<cmath>#include<map>#define N

2017-09-19 00:54:37 674

原创 统计难题 HDU - 1251 (字典树)

Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input 输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串. 注意:

2017-09-18 17:53:42 410

原创 physics HDU - 5826(数学)

There are n balls on a smooth horizontal straight track. The track can be considered to be a number line. The balls can be considered to be particles with the same mass.At the beginning, ball i is at p

2017-09-17 23:56:16 261

原创 A Cubic number and A Cubic Number HDU - 6216 (数学)

A cubic number is the result of using a whole number in a multiplication three times. For example, 3×3×3=27so 27 is a cubic number. The first few cubic numbers are 1,8,27,64 and 125. Given an prime num

2017-09-17 23:27:26 340

原创 Counting Intersections HDU - 5862(离散化+树状数组)

Given some segments which are paralleled to the coordinate axis. You need to count the number of their intersection. The input data guarantee that no two segments share the same endpoint, no covered se

2017-09-16 00:42:31 280

原创 Connections between cities HDU - 2874(LCA)(RMQ)(dfs)(st算法)

After World War X, a lot of cities have been seriously damaged, and we need to rebuild those cities. However, some materials needed can only be produced in certain places. So we need to transport these

2017-09-15 16:38:59 338

原创 Escape HDU - 3605 (最大流)(多重匹配)

2012 If this is the end of the world how to do? I do not know how. But now scientists have found that some stars, who can live, but some people do not fit to live some of the planet. Now scientists wan

2017-09-15 11:45:49 406

原创 网络流三·二分图多重匹配 HihoCoder - 1393

描述学校的秋季运动会即将开始,为了决定参赛人员,各个班又开始忙碌起来。小Hi和小Ho作为班上的班干部,统计分配比赛选手的重任也自然交到了他们手上。已知小Hi和小Ho所在的班级一共有N名学生(包含小Hi和小Ho),编号依次为1..N。运动会一共有M项不同的比赛,编号为1..M。第i项比赛每个班需要派出m[i]名选手参加。根据小Hi和小Ho的统计,编号为i的学生表示最多同时参加a[i]项比赛,并且给出他

2017-09-14 22:23:36 281

原创 Peaceful Commission HDU - 1814(2-SAT)

The Public Peace Commission should be legislated in Parliament of The Democratic Republic of Byteland according to The Very Important Law. Unfortunately one of the obstacles is the fact that some deput

2017-09-13 20:16:08 336

原创 transaction transaction transaction HDU - 6201(spfa变式)

Kelukin is a businessman. Every day, he travels around cities to do some business. On August 17th, in memory of a great man, citizens will read a book named “the Man Who Changed China”. Of course, Kelu

2017-09-11 15:08:50 321

原创 Jesus Is Here HDU - 5459 (斐波那契)

I’ve sent Fang Fang around 201314 text messages in almost 5 years. Why can’t she make sense of what I mean? “But Jesus is here!” the priest intoned. “Show me your messages.” Fine, the first message

2017-09-09 00:38:18 318

原创 Necklace UVA - 11255(polya计数)

传送门 题目大意是给你三种颜色并给定相应的数量,请问能组成多少种不同的环(选择,对称同构) Sample Input 2 3 2 1 2 2 2 Sample Output 6 11 颜色的个数类带有了限制,因为是对于环来说,所以其实还是比较好处理的 因为数量有了限制,所以不能单纯考虑置换的循环节的个数还要考虑循环节的数量。 先看旋转的情况,其实一直旋转后的置换的循环节的长度都

2017-09-08 16:40:10 313

原创 Invoker HDU - 3923(polya)

On of Vance’s favourite hero is Invoker, Kael. As many people knows Kael can control the elements and combine them to invoke a powerful skill. Vance like Kael very much so he changes the map to make Ka

2017-09-08 13:56:08 310

原创 hannnnah_j’s Biological Test HDU - 5894 (组合数)

hannnnah_j is a teacher in WL High school who teaches biology.One day, she wants to test m students, thus she arranges n different seats around a round table.In order to prevent cheating, she thinks th

2017-09-08 12:16:26 410

原创 Different Circle Permutation HDU - 5868(burnside引理+递推+矩阵快速幂+欧拉函数)

You may not know this but it’s a fact that Xinghai Square is Asia’s largest city square. It is located in Dalian and, of course, a landmark of the city. It’s an ideal place for outing any time of the y

2017-09-07 13:58:35 426

原创 Invade the Mars HDU - 3873(最短路变体)

It’s now the year 21XX,when the earth will explode soon.The evil U.S. decided to invade the Mars to save their lives. But the childlike Marsmen never keeps any army,because war never take place on th

2017-09-04 21:27:12 411

原创 Weak Pair HDU - 5877(树状数组+离散化)

You are given a rooted tree of N nodes, labeled from 1 to N. To the ith node a non-negative value ai is assigned.An ordered pair of nodes (u,v) is said to be weak if (1) u is an ancestor of v (Note

2017-09-03 19:28:02 367

原创 Lucky7 HDU - 5768(中国剩余定理+容斥定理)

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 sent it back to the s

2017-09-03 14:09:47 378

原创 World is Exploding HDU - 5792 (离散化+树状数组)

Given a sequence A with length n,count how many quadruple (a,b,c,d) satisfies: a≠b≠c≠d,1≤a<b≤n,1≤c<d≤n,Aa<Ab,Ac>Ad,a≠b≠c≠d,1≤a<b≤n,1≤c<d≤n,Aa<Ab,Ac>Ada≠b≠c≠d,1≤a<b≤n,1≤c<d≤n,A_a<A_b,A_c>A_d,a≠b≠c≠d,1≤a

2017-09-03 09:17:22 272

原创 Two HDU - 5791 (DP)

Alice gets two sequences A and B. A easy problem comes. How many pair of sequence A’ and sequence B’ are same. For example, {1,2} and {1,2} are same. {1,2,4} and {1,4,2} are not same. A’ is a subsequen

2017-09-02 16:06:24 313

空空如也

空空如也

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

TA关注的人

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