- 博客(53)
- 收藏
- 关注
原创 UVALive 6955 Finding Lines
点击打开链接随机选一条线段然后判断是否满足答案,然后执行一定的次数,基本可以保证正确。#include#include#include#include#includeusing namespace std;typedef long long LL;const int maxn = 100005;int T, n, m, ans, x[maxn], y[maxn];
2015-08-26 21:36:08 537
原创 UVALive 6953 Digi Comp II
点击打开链接拓扑排序,顺便记录一下答案#include#include#include#include#include#includeusing namespace std;typedef long long LL;const int maxn = 500015;LL n, sum[maxn], T, m, flag[maxn], in[maxn];int
2015-08-26 21:33:13 700
原创 HDU 5411 CRB and Puzzle
Problem DescriptionCRB is now playing Jigsaw Puzzle.There are N kinds of pieces with infinite supply.He can assemble one piece to the right side of the previously assembled one.For each ki
2015-08-20 17:16:38 653
原创 HDU 5402 Travelling Salesman Problem
Problem DescriptionTeacher Mai is in a maze with n rows and m columns. There is a non-negative number in each cell. Teacher Mai wants to walk from the top left corner (1,1) to the bottom rig
2015-08-18 17:13:20 840
原创 HDU 5400 Arithmetic Sequence
Problem DescriptionA sequence b1,b2,⋯,bn are called (d1,d2)-arithmetic sequence if and only if there exist i(1≤i≤n) such that for every j(1≤ji),bj+1=bj+d1 and for every j(i≤jn),bj+1=bj+d2.
2015-08-18 17:08:51 538
原创 HDU 5399 Too Simple
Problem DescriptionRhason Cheung had a simple problem, and asked Teacher Mai for help. But Teacher Mai thought this problem was too simple, sometimes naive. So she ask you for help.Teacher Mai
2015-08-18 17:06:12 820 2
原创 HDU 5387 Clock
Problem DescriptionGive a time.(hh:mm:ss),you should answer the angle between any two of the minute.hour.second handNotice that the answer must be not more 180 and not less than 0 Inpu
2015-08-13 21:49:45 459
原创 HDU 5384 Danganronpa
Problem DescriptionDanganronpa is a video game franchise created and developed by Spike Chunsoft, the series' name is compounded from the Japanese words for "bullet" (dangan) and "refutation" (ron
2015-08-13 21:48:34 427
原创 HDU 1828 Picture
Problem DescriptionA number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle can be partial
2015-08-12 19:20:39 479
原创 HDU 1255 覆盖的面积
Problem Description给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积. Input输入数据的第一行是一个正整数T(1注意:本题的输入数据较多,推荐使用scanf读入数据. Output对于每组测试数据,请计算出被这些矩形覆盖过至少两次的区域的面积.结果保留两位小数.
2015-08-12 17:33:14 276
原创 HDU 1542 Atlantis
Problem DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, t
2015-08-12 17:14:07 419
原创 HDU 3308 LCIS
Problem DescriptionGiven n integers.You have two operations:U A B: replace the Ath number by B. (index counting from 0)Q A B: output the length of the longest consecutive increasing subseque
2015-08-12 14:22:36 314
原创 HDU 3397 Sequence operation
Problem Descriptionlxhgww got a sequence contains n characters which are all '0's or '1's.We have five operations here:Change operations:0 a b change all characters into '0's in [a , b]1 a
2015-08-12 13:41:19 297
原创 HDU 1199 Color the Ball
Problem DescriptionThere are infinite balls in a line (numbered 1 2 3 ....), and initially all of them are paint black. Now Jim use a brush paint the balls, every time give two integers a b and fo
2015-08-11 22:08:37 598
原创 HDU 5379 Mahjong tree
Problem DescriptionLittle sun is an artist. Today he is playing mahjong alone. He suddenly feels that the tree in the yard doesn't look good. So he wants to decorate the tree.(The tree has n verte
2015-08-11 19:59:58 611
原创 HDU 5375 Gray code
Problem DescriptionThe reflected binary code, also known as Gray code after Frank Gray, is a binary numeral system where two successive values differ in only onebit (binary digit). The reflected b
2015-08-11 19:57:42 275
原创 HDU 5373 The shortest problem
Problem DescriptionIn this problem, we should solve an interesting game. At first, we have an integer n, then we begin to make some funny change. We sum up every digit of the n, then insert it to
2015-08-11 19:56:14 431
原创 HDU 5372 Segment Game
Problem DescriptionLillian is a clever girl so that she has lots of fans and often receives gifts from her fans.One day Lillian gets some segments from her fans Lawson with lengths of 1,2,3...
2015-08-11 19:53:33 523
原创 HYSBZ 2038 小Z的袜子(hose)
Description作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命……具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是否一左一右,他却很在意袜子的颜色,毕竟穿两只不同色的袜子会很尴尬。你的任务便是告诉
2015-08-10 19:54:27 720
原创 HDU 5367 digger
Problem DescriptionAFa have n mountains. These mountains in a line。All of mountains have same height initially. Every day , AFa would request ZJiaQ to cut some mountains or put stones in some moun
2015-08-09 22:33:52 723
原创 POJ 2528 Mayor's posters
DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city coun
2015-08-09 17:44:18 362
原创 HDU 5366 The mook jong
Problem DescriptionZJiaQ want to become a strong man, so he decided to play the mook jong。ZJiaQ want to put some mook jongs in his backyard. His backyard consist of n bricks that is 1*1,so it is
2015-08-09 15:42:35 348
原创 HDU 5365 Run
Problem DescriptionAFA is a girl who like runing.Today,he download an app about runing .The app can record the trace of her runing.AFA will start runing in the park.There are many chairs in the pa
2015-08-09 15:40:33 304
原创 HDU 5364 Distribution money
Problem DescriptionAFA want to distribution her money to somebody.She divide her money into n same parts.One who want to get the money can get more than one part.But if one man's money is more tha
2015-08-09 15:38:10 370
原创 POJ 2374 Fence Obstacle Course
DescriptionFarmer John has constructed an obstacle course for the cows' enjoyment. The course consists of a sequence of N fences (1 The door to FJ's barn is at the origin (marked '*' below).
2015-08-09 15:31:05 510
原创 POJ 3254 Corn Fields
DescriptionFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squar
2015-08-09 15:29:25 343
原创 POJ 4045 Power Station
Description The massive tsunami that struck the coastal city has washed away many of inhabitants and facilities there. After the tsunami, the power supply facilities of the coastal city
2015-08-09 15:27:53 558
原创 POJ 1276 Cash Machine
DescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denomin
2015-08-09 15:24:41 335
原创 UVA 442 Matrix Chain Multiplication
DescriptionSuppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which multiplications are perfor
2015-08-09 15:23:14 350
原创 FZU 1182 Argus
DescriptionA data stream is a real-time, continuous, ordered sequence of items. Some examples include sensor data, Internet traffic, financial tickers, on-line auctions, and transaction logs such
2015-08-09 15:22:11 362
原创 FZU 1171 Hard to Believe, but True!
DescriptionThe fight goes on, whether to store numbers starting with their most significant digit or their least significant digit. Sometimes this is also called the "Endian War". The battleground
2015-08-09 15:20:20 656
原创 FZU 1150 Farmer Bill's Problem
DescriptionPeter has n cigarettes. He smokes them one by one keeping all the butts. Out of k > 1 butts he can roll a new cigarette.How many cigarettes can Peter have?InputInput is
2015-08-09 15:18:15 386
原创 FZU 1003 Counterfeit Dollar
DescriptionSally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true silver dollars; one coin is counterfeit even though its color and size make it indistinguisha
2015-08-09 15:16:49 1508
原创 FZU 1002 HangOver
DescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicul
2015-08-09 15:15:21 396
原创 FZU 1001 Duplicate Pair
DescriptionAn array of length n, with address from 1 to n inclusive, contains entries from the set {1,2,...,n-1} and there's exactly two elements with the same value. Your task is to find out the
2015-08-09 15:13:45 634
原创 HDU 5361 In Touch
Problem DescriptionThere are n soda living in a straight line. soda are numbered by 1,2,…,n from left to right. The distance between two adjacent soda is 1 meter. Every soda has a teleporter. Th
2015-08-07 17:07:40 844
原创 HDU 5358 First One
Problem Descriptionsoda has an integer array a1,a2,…,an. Let S(i,j) be the sum of ai,ai+1,…,aj. Now soda wants to know the value below:∑i=1n∑j=in(⌊log2S(i,j)⌋+1)×(i+j)Note: In this p
2015-08-07 15:35:40 401
原创 HDU 5363 Key Set
Problem Descriptionsoda has a set S with n integers {1,2,…,n}. A set is called key set if the sum of integers in the set is an even number. He wants to know how many nonempty subsets of S are
2015-08-06 18:51:25 412
原创 HDU 5360 Hiking
Problem DescriptionThere are n soda conveniently labeled by 1,2,…,n. beta, their best friends, wants to invite some soda to go hiking. The i-th soda will go hiking if the total number of sod
2015-08-06 18:43:17 760
原创 HDU 5353 Average
Problem DescriptionThere are n soda sitting around a round table. soda are numbered from 1 to n and i-th soda is adjacent to (i+1)-th soda, 1-st soda is adjacent to n-th soda.Each so
2015-08-06 18:41:14 874
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人