- 博客(53)
- 收藏
- 关注
原创 Makefile学习笔记
参考文章 makefile实现了linux下整个工程的自动编译和生成,特别是在复杂工程下用得很多。 makefile的规则很简单: target … : prerequisites … command … … 其中target是你要的目标文件,prerequisites是它的依赖文件,下面的command就是具体的指令了。 一个简单的例子edit : main.o kbd.o com
2018-04-29 13:39:36
175
原创 Codeforces 883G Orientation of Edges(BFS+MAP)
原题链接Problem DescriptionVasya has a graph containing both directed (oriented) and undirected (non-oriented) edges. There can be multiple edges between a pair of vertices.Vasya has picked a vertex s from
2017-10-23 20:59:38
452
原创 HDU 5972 Regular Number(Shift-And)
原题链接Problem DescriptionUsing regular expression to define a numeric string is a very common thing. Generally, use the shape as follows: (0|9|7) (5|6) (2) (4|5) Above regular expression matches 4 digi
2017-09-14 22:09:47
274
原创 HDU 5975 Aninteresting game(树状数组)
原题链接Problem DescriptionLet’s play a game.We add numbers 1,2…n in increasing order from 1 and put them into some sets. When we add i,we must create a new set, and put iinto it.And meanwhile we have to
2017-09-14 19:57:57
420
原创 HDU 6161 Big binary tree(树形DP)
原题链接Problem DescriptionYou are given a complete binary tree with n nodes. The root node is numbered 1, and node x’s father node is ⌊x/2⌋. At the beginning, node x has a value of exactly x. We define th
2017-08-23 16:51:08
574
原创 POJ 3630 Phone List(Trie)
原题链接Problem DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:Emergency 91
2017-08-21 17:05:45
209
原创 HDU 4821 String(Hash)
原题链接Problem DescriptionGiven a string S and two integers L and M, we consider a substring of S as “recoverable” if and only if (i) It is of length M*L; (ii) It can be constructed by concatenating
2017-08-21 16:22:29
325
原创 HDU 6097 Mindis(计算几何)
原题链接Problem DescriptionThe center coordinate of the circle C is O, the coordinate of O is (0,0) , and the radius is r. P and Q are two points not outside the circle, and PO = QO. You need to find a p
2017-08-14 18:52:47
327
原创 HDU 6103 Kirinriki(尺取法)
原题链接Problem DescriptionInputOutputFor each test case output one interge denotes the answer : the maximum length of the substring.Sample Input1 5 abcdefedcbSample Output5题目大意给定一个字符串,要找出它的两个长度相同的子串,使得这
2017-08-14 18:46:17
211
原创 Codeforces 853C Star sky(二维前缀和)
原题链接Problem DescriptionThe Cartesian coordinate system is set in the sky. There you can see n stars, the i-th has coordinates (xi, yi), a maximum brightness c, equal for all stars, and an initial brigh
2017-08-13 11:24:34
1360
原创 Codeforces 834D The Bakery(dp+线段树)
原题链接Problem DescriptionSome 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 bake
2017-08-01 14:47:59
361
原创 CCPC2017-江苏省省赛总结
这次省赛总得来说还是达到了预期目标的,靠着队友carry拿到了一等奖(也就是银),但是在这个过程中还是暴露了不少问题的。 首先是比赛当天,我们18个人乘公交乘过了头,还好及时发现,赶在热身赛结束前15分钟到了比赛场地,一看热身赛A题,就是求个逆序对,连忙掏出书抄板子,在结束前没几分钟A掉,也算是测试了一把机器,这次机器有Sublime还是给好评。 到了正式比赛,按照以往省赛套路,A题都是
2017-05-15 19:36:32
1929
1
原创 POJ 1156 The Doors(线段相交+最短路)
原题链接Problem DescriptionYou are to find the length of the shortest path through a chamber containing obstructing walls. The chamber will always have sides at x = 0, x = 10, y = 0, and y = 10. The initia
2017-04-25 20:53:21
289
原创 POJ 3304 Segments(线段相交)
原题链接Problem 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 ha
2017-04-24 21:28:45
261
原创 POJ 2828 Buy Tickets(线段树)
原题链接Problem DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Litt
2017-04-18 21:01:15
226
原创 POJ 3481 Double Queue(Splay)
原题链接Problem DescriptionThe new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Bucharest, equipped with a modern computing environment provided by IBM Romania, and using modern i
2017-04-18 20:42:13
406
原创 UESTC 1060 秋实大哥与快餐店(字典树)
原题链接Problem Description朝为田舍郎,暮登天子堂。秋实大哥从小就怀抱有远大的理想,所以他开了一家快餐店。秋实大哥根据菜的口感,给每一道菜一个唯一的CID,同时对于前来的客人,根据他们的口味喜好,秋实大哥会给每一个客人一个PID。对于一个标号为PID的客人,他对标号为CID的菜的喜爱程度为PID∧CID(∧表示按位异或),该值越大表示越喜欢。秋实大哥实在太忙了,现在他需要你来帮忙照
2017-04-18 20:19:09
332
原创 UESTC 1059 秋实大哥与小朋友(线段树+离散化)
原题链接Problem Description秋实大哥以周济天下,锄强扶弱为己任,他常对天长叹:安得广厦千万间,大庇天下寒士俱欢颜。所以今天他又在给一群小朋友发糖吃。他让所有的小朋友排成一行,从左到右标号。在接下去的时间中,他有时会给一段区间的小朋友每人v颗糖,有时会问第x个小朋友手里有几颗糖。这对于没上过学的孩子来说实在太困难了,所以你看不下去了,请你帮助小朋友回答所有的询问。Input第一行包含
2017-04-18 20:08:45
300
原创 HDU 2966 In case of failure(k-dTree)
原题链接Problem DescriptionTo help their clients deal with faulty Cash Machines, the board of The Planar Bank has decided to stick a label expressing sincere regret and sorrow of the bank about the failure
2017-03-21 21:35:31
432
原创 POJ 3729 Facer's string (后缀数组)
原题链接Problem DescriptionMinifacer was very happy these days because he has learned the algorithm of KMP recently. Yet his elder brother, Hugefacer, thought that Minifacer needs a deeper understanding of
2017-03-15 20:48:59
658
原创 POJ 3581 Sequence(后缀数组)
原题链接Problem DescriptionGiven a sequence, {A1, A2, …, An} which is guaranteed A1 > A2, …, An, you are to cut it into three sub-sequences and reverse them separately to form a new one which is the small
2017-03-15 20:22:46
620
原创 POJ 1509 Glass Beads(最小表示法)
原题链接Problem DescriptionOnce upon a time there was a famous actress. As you may expect, she played mostly Antique Comedies most of all. All the people loved her. But she was not interested in the crowds
2017-03-15 20:03:27
555
原创 POJ 2217 Secretary (后缀数组)
原题链接Problem DescriptionThe basic condition of success of a political party, it is the good Election Programme. PSOS know about it, so they entrust the top secretary Juliet with this task. Because she w
2017-03-15 18:54:02
261
原创 Codeforces 782C Andryusha and Colored Balloons(BFS)
原题链接Problem DescriptionAndryusha goes through a park each day. The squares and paths between them look boring to Andryusha, so he decided to decorate them.The park consists of n squares connected with
2017-03-06 23:24:22
776
原创 HDU 5738 Eureka(计数)
原题链接Problem DescriptionInputOutputFor each test case, output an integer denoting the answer.Sample Input3 3 1 1 1 1 1 1 3 0 0 0 1 1 0 1 0 0Sample Output4 3 0题目大意给定平面上的n个点(可重合),要求这些点一共可以组成多少
2017-03-06 23:10:32
190
原创 HDU 5733 tetrahedron(计算几何)
原题链接Problem DescriptionGiven four points ABCD, if ABCD is a tetrahedron, calculate the inscribed sphere of ABCD.InputMultiple test cases (test cases ≤100).Each test cases contains a line of 12 integers
2017-02-25 15:31:13
284
1
原创 POJ 1651 Multiplication Puzzle(区间DP)
原题链接Problem DescriptionThe multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of
2017-02-23 19:22:20
157
原创 UVA 11996 Jewel Magic(伸展树)
原题链接Problem DescriptionI am a magician. I have a string of emeralds and pearls. I may insert new jewels in the string, or remove old ones. I may even reverse a consecutive part of the string. At anyti
2017-02-23 18:46:37
259
原创 HDU 5726 GCD(Sparse-Table+二分)
原题链接Problem DescriptionGive you a sequence of N(N≤100,000) integers : a1,…,an(0< ai≤1000,000,000). There are Q(Q≤100,000) queries. For each query l,r you have to calculate gcd(al,,al+1,…,ar) and count
2017-02-21 16:36:35
227
原创 UVA 11020 Efficient Solutions(STL,set)
原题链接Problem DescriptionThe princess of Centauri Prime is the galaxy’s most eligible bachelorette of the year. She has hopeful grooms lined up in front of the royal palace for a chance to spend 5 minut
2017-02-17 21:11:39
276
原创 Codeforces 766 C Mahmoud and a Message(DP)
原题链接Problem DescriptionMahmoud wrote a message s of length n. He wants to send it as a birthday present to his friend Moaz who likes strings. He wrote it on a magical paper but he was surprised because
2017-02-17 20:53:37
384
原创 POJ 3057 Evacuation(BFS+二分图匹配)
原题链接Problem DescriptionFires can be disastrous, especially when a fire breaks out in a room that is completely filled with people. Rooms usually have a couple of exits and emergency exits, but with eve
2017-02-14 23:05:56
272
原创 UVA 11992 Fast Matrix Operations(线段树)
原题链接Problem DescriptionThere is a matrix containing at most 106 elements divided into r rows and c columns. Each element has a location (x, y) where 1 ≤ x ≤ r, 1 ≤ y ≤ c. Initially, all the elements
2017-02-08 18:07:06
265
原创 UVALive - 3938 "Ray, Pass me the dishes!" (线段树)
原题链接Problem DescriptionAfter doing Ray a great favor to collect sticks for Ray, Poor Neal becomes very hungry. In return for Neal’s help, Ray makes a great dinner for Neal. When it is time for dinner,
2017-02-08 03:42:12
468
2
原创 UVA 11235 Frequent values(RMQ)
原题链接Problem DescriptionYou are given a sequence of n integers a1, a2, … , an in non-decreasing order. In addition to that, you are given several queries consisting of indices i and j (1 ≤ i ≤ j ≤ n).
2017-02-08 03:29:13
238
原创 UVALive 4329 Ping pong(树状数组)
原题链接Problem DescriptionN (3 ≤ N ≤ 20000) ping pong players live along a west-east street(consider the street as a line segment). Each player has a unique skill rank. To improve their skill rank, they
2017-02-08 03:17:51
252
原创 POJ 2187 Beauty Contest (凸包)
原题链接Problem 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,
2017-01-21 01:25:20
231
原创 POJ 1127(Jack Straws )(线段相交)
原题链接Problem DescriptionIn the game of Jack Straws, a number of plastic or wooden “straws” are dumped on the table and players try to remove them one-by-one without disturbing the other straws. Here, we
2017-01-19 18:04:54
267
原创 Meisell-Lehmer(1000亿以内的素数统计)(模板)
#include<bits/stdc++.h>using namespace std;typedef long long LL;const int N = 5e6 + 2;bool np[N];int prime[N], pi[N];int getprime() { int cnt = 0; np[0] = np[1] = true; pi[0] = pi[1]
2017-01-15 01:22:24
519
原创 POJ 3255 Roadblocks (次短路)
原题链接Problem DescriptionBessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scen
2017-01-14 23:06:51
237
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人