- 博客(39)
- 收藏
- 关注
原创 hdu 5675 && BestCoder Round #82 ztr loves math(技巧题)
Problem Descriptionztr loves research Math.One day,He thought about the "Lower Edition" of triangle equation set.Such as n=x2−y2.He wanted to know that ,for a given number n,is there a positiv
2016-04-30 22:53:28 813
原创 hdu 5119 Happy Matt Friends(穷举子集类dp)
Problem DescriptionMatt has N friends. They are playing a game together.Each of Matt’s friends has a magic number. In the game, Matt selects some (could be zero) of his friends. If the xor (ex
2016-04-25 23:32:59 3317
原创 hdu 1159 && POJ 1458Common Subsequence(LCS)
Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there e
2016-04-25 23:24:47 320
原创 poj 1159 && hdu 1513 Palindrome(LCS)
DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines t
2016-04-25 23:21:27 343
原创 poj 2975 Nim(博弈)
DescriptionNim is a 2-player game featuring several piles of stones. Players alternate turns, and on his/her turn, a player’s move consists of removing one or more stones from any single pile. P
2016-04-25 23:12:42 348
原创 bzoj 1845: [Cqoi2005] 三角形面积并(计算几何)
Description给出n个三角形,求它们并的面积。Input第一行为n(N Output输出并的面积u, 保留两位小数Sample Input20.0 0.0 2.0 0.0 1.0 1.01.0 0.0 3.0 0.0 2.0 1.0Sample Output1.75#include#include#incl
2016-04-23 09:55:46 561
原创 bzoj 1036: [ZJOI2008]树的统计Count(树链剖分 点权)
Description 一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w。我们将以下面的形式来要求你对这棵树完成一些操作: I. CHANGE u t : 把结点u的权值改为t II. QMAX u v: 询问从点u到点v的路径上的节点的最大权值 III. QSUM u v: 询问从点u到点v的路径上的节点的权值和 注意:从点u到点v的路径上的节点包括u和v本身
2016-04-23 09:54:02 1336
原创 bzoj 1022: [SHOI2008]小约翰的游戏John(反nim游戏)
Description 小约翰经常和他的哥哥玩一个非常有趣的游戏:桌子上有n堆石子,小约翰和他的哥哥轮流取石子,每个人取的时候,可以随意选择一堆石子,在这堆石子中取走任意多的石子,但不能一粒石子也不取,我们规定取到最后一粒石子的人算输。小约翰相当固执,他坚持认为先取的人有很大的优势,所以他总是先取石子,而他的哥哥就聪明多了,他从来没有在游戏中犯过错误。小约翰一怒之前请你来做他
2016-04-23 09:50:41 918 1
原创 bzoj 1012: [JSOI2008]最大数maxnumber(线段树)
Description 现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。2、 插入操作。语法:A n 功能:将n加上t,其中t是最近一次查询操作的答案(如果还未执行过查询操作,则t=0),并将所得结果对一个固定的常数D取模,将所得答案插入到数列的末尾。限制:
2016-04-23 09:48:35 482
原创 bzoj 1029: [JSOI2007]建筑抢修(贪心+优先队列)
Description 小刚在玩JSOI提供的一个称之为“建筑抢修”的电脑游戏:经过了一场激烈的战斗,T部落消灭了所有z部落的入侵者。但是T部落的基地里已经有N个建筑设施受到了严重的损伤,如果不尽快修复的话,这些建筑设施将会完全毁坏。现在的情况是:T部落基地里只有一个修理工人,虽然他能瞬间到达任何一个建筑,但是修复每个建筑都需要一定的时间。同时,修理工人修理完一个建筑才能修理
2016-04-23 09:45:01 907
原创 hdu 5660 jrMz and angles(水题)
Problem DescriptionjrMz has two types of angles, one type of angle is an interior angle of n-sided regular polygon, and the other type of angle is an interior angle of m-sided regular polygon.
2016-04-23 09:39:45 299
原创 hdu 5670 Machine(水题)
Problem DescriptionThere is a machine with m(2≤m≤30) coloured bulbs and a button.When the button is pushed, the rightmost bulb changes.For any changed bulb,if it is red now it will be gree
2016-04-23 09:37:34 305
原创 hdu 5671 Matrix(模拟)
Problem DescriptionThere is a matrix M that has n rows and m columns (1≤n≤1000,1≤m≤1000).Then we perform q(1≤q≤100,000) operations:1 x y: Swap row x and row y (1≤x,y≤n);2 x y: Swap c
2016-04-23 09:35:03 420
原创 hdu 5672 String(尺取)
Problem DescriptionThere is a string S.S only contain lower case English character.(10≤length(S)≤1,000,000)How many substrings there are that contain at least k(1≤k≤26) distinct characters?
2016-04-23 09:31:55 614
原创 poj 3186 Treats for the Cows(区间dp)
DescriptionFJ has purchased N (1 The treats are interesting for many reasons:The treats are numbered 1..N and stored sequentially in single file in a long box that is open at both ends. On
2016-04-23 09:25:22 330
原创 Codeforces 558C. Amr and Chemistry(暴搞)
Amr loves Chemistry, and specially doing experiments. He is preparing for a new interesting experiment.Amr has n different types of chemicals. Each chemical i has an initial volume of ai liters.
2016-04-22 18:01:22 1251
原创 Codeforces 579A. Raising Bacteria(位运算)
You are a lover of bacteria. You want to raise some bacteria in a box.Initially, the box is empty. Each morning, you can put any number of bacteria into the box. And each night, every bacterium in
2016-04-22 17:58:33 503
原创 CSU 1515: Sequence(莫队算法)
DescriptionGive you a sequence consisted of n numbers. You are required to answer how many pairs of numbers (ai, aj) satisfy that | ai - aj | = 1 and L ≤ i InputThe input consists of
2016-04-20 20:37:45 380
原创 codeforces 86D. Powerful array(莫队算法)
An array of positive integers a1, a2, ..., an is given. Let us consider its arbitrary subarray al, al + 1..., ar, where 1 ≤ l ≤ r ≤ n. For every positive integer s denote by Ks the number of o
2016-04-20 20:35:27 2369
原创 bzoj 2038: [2009国家集训队]小Z的袜子(hose)(莫队算法)
Description作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命……具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是否一左一右,他却很在意袜子的颜色,毕竟穿两只不同色的袜子会很尴尬。你的任务便是告诉小Z
2016-04-20 20:32:25 1311
原创 bzoj 1878: [SDOI2009]HH的项链(莫队算法)
DescriptionHH有一串由各种漂亮的贝壳组成的项链。HH相信不同的贝壳会带来好运,所以每次散步 完后,他都会随意取出一段贝壳,思考它们所表达的含义。HH不断地收集新的贝壳,因此, 他的项链变得越来越长。有一天,他突然提出了一个问题:某一段贝壳中,包含了多少种不同 的贝壳?这个问题很难回答。。。因为项链实在是太长了。于是,他只好求助睿智的你,来解 决这个问题。Input第
2016-04-20 20:30:30 1288
原创 hdu 4638 Group(莫队算法)
Problem DescriptionThere are n men ,every man has an ID(1..n).their ID is unique. Whose ID is i and i-1 are friends, Whose ID is i and i+1 are friends. These n men stand in line. Now we select an
2016-04-20 20:26:18 1625 1
原创 hdu 5666 Segment(快速乘)
Problem Description Silen August does not like to talk with others.She like to find some interesting problems. Today she finds an interesting problem.She finds a segment x+y=q.The
2016-04-20 20:22:37 538
原创 hdu 5667 Sequence(矩阵快速幂)
Problem Description Holion August will eat every thing he has found. Now there are many foods,but he does not want to eat all of them at once,so he find a sequence.fn=⎧⎩⎨⎪⎪1,ab,a
2016-04-20 20:19:28 4273
原创 poj 2663 Tri Tiling(推公式)
DescriptionIn how many ways can you tile a 3xn rectangle with 2x1 dominoes? Here is a sample tiling of a 3x12 rectangle. InputInput consists of several test cases followed by a line co
2016-04-10 20:49:51 340
原创 poj 2299 Ultra-QuickSort(求逆序对)
DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the seque
2016-04-10 20:46:27 438
原创 poj 1804 Brainman(求逆序对)
DescriptionBackground Raymond Babbitt drives his brother Charlie mad. Recently Raymond counted 246 toothpicks spilled all over the floor in an instant just by glancing at them. And he can even c
2016-04-10 20:45:16 949
原创 poj 3067 Japan(求逆序对)
DescriptionJapan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M <
2016-04-10 20:43:57 398
原创 poj 1042 Gone Fishing(贪心)
DescriptionJohn is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are n lakes in the area (2 <= n <= 25) all reachable along a single, one-way road. John starts at lak
2016-04-10 20:41:12 509
原创 poj 3264 Balanced Lineup(ST)
DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows.
2016-04-10 20:38:29 400
原创 hdu 1556 Color the ball(线段树lazy)
Problem DescriptionN个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a Input每个测试实例第一行为一个整数N,(N 当N = 0,输入结束。 Output每个测试实例输出一行,包括N个整数,第I个数代表第I个气球总共被涂色的次数。 Sample Inpu
2016-04-10 20:34:21 419
原创 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
2016-04-10 20:31:42 461
原创 hdu 5650 so easy(水题)
Problem DescriptionGiven an array withnintegers, assume f(S) as the result of executing xor operation among all the elements of set S. e.g. if S={1,2,3} then f(S)=0.your task is: cal
2016-04-10 20:28:26 488
原创 hdu 3795 Billboard(线段树)
Problem DescriptionAt the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcement
2016-04-10 20:26:19 491
原创 hdu 4251 The Famous ICPC Team Again(划分树)
Problem DescriptionWhen Mr. B, Mr. G and Mr. M were preparing for the 2012 ACM-ICPC World Final Contest, Mr. B had collected a large set of contest problems for their daily training. When they dec
2016-04-10 20:24:27 368
原创 hdu 5655 CA Loves Stick(水题)
Problem DescriptionCA loves to play with sticks.One day he receives four pieces of sticks, he wants to know these sticks can spell a quadrilateral.(What is quadrilateral? Click here: https://e
2016-04-10 20:19:46 318
原创 hdu 5656 CA Loves GCD(穷举子集类dp)
Problem DescriptionCA is a fine comrade who loves the party and people; inevitably she loves GCD (greatest common divisor) too. Now, there are N different numbers. Each time, CA will select se
2016-04-10 20:15:51 488
原创 hdu 3183 A Magic Lamp(ST表)
Problem DescriptionKiki likes traveling. One day she finds a magic lamp, unfortunately the genie in the lamp is not so kind. Kiki must answer a question, and then the genie will realize one of her dre
2016-04-10 20:10:23 442
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人