自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Spectacules的博客

思路决定出路

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

原创 POJ 2418 Hardwood Species(二叉搜索树BST)

Hardwood SpeciesDescriptionHardwoods are the botanical group of trees that have broad leaves, produce a fruit or nut, and generally go dormant in the winter.America's temperate climates prod

2015-10-12 18:04:53 479

原创 HDU 1212 Big Number(大数取模)

Big NumberProblem Description As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B.To make the pr

2015-10-07 21:42:31 468

原创 HDU 1018 Big Number(斯特林公式)

Big NumberProblem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this pr

2015-10-07 21:13:59 497

原创 HDU 3398 String(整数唯一分解定理)

StringProblem DescriptionRecently, lxhgww received a task : to generate strings contain '0's and '1's only, in which '0' appears exactly m times, '1' appears exactly n times. Also, any prefix

2015-10-07 15:46:16 480

原创 HDU 1950 Bridging signals(树状数组)

Bridging signalsProblem Description'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making the

2015-10-06 21:47:01 447

原创 HDU 1950 Bridging signals(LIS)

Bridging signalsProblem Description'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making the

2015-10-06 17:28:12 382

原创 九度OJ 1533 最长上升子序列 (基于贪心和二分查找)

题目描述: 给定一个整型数组, 求这个数组的最长严格递增子序列的长度。 譬如序列1 2 2 4 3 的最长严格递增子序列为1,2,4或1,2,3.他们的长度为3。输入: 输入可能包含多个测试案例。对于每个测试案例,输入的第一行为一个整数n(1输入的第二行包括n个整数,代表这个数组中的数字。整数均在int范围内。输出: 对于每个测试案例,输出其最长严格递增

2015-10-06 16:39:10 466

原创 HDU 3874 Necklace(树状数组 && 离线操作)

NecklaceProblem DescriptionMery has a beautiful necklace. The necklace is made up of N magic balls. Each ball has a beautiful value. The balls with the same beautiful value look the same, so if

2015-10-05 16:38:54 520

原创 HDU 1250 Hat's Fibonacci(大数相加)

Hat's FibonacciProblem DescriptionA Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1.F(1) = 1, F(2) = 1, F(3) = 1,F(4)

2015-10-05 10:29:33 399

原创 HDU 1063 Exponentiation(高精度求幂)

ExponentiationProblem DescriptionProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxin

2015-10-05 10:16:27 373

原创 HDU 3792 Twin Prime Conjecture(素数筛法 + 树状数组)

Twin Prime ConjectureProblem DescriptionIf we define dn as: dn = pn+1-pn, where pi is the i-th prime. It is easy to see that d1 = 1 and dn=even for n>1. Twin Prime Conjecture states that "There

2015-10-04 20:54:46 552

原创 HDU 1166 敌兵布阵(树状数组)

敌兵布阵Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不

2015-10-04 10:26:53 398

原创 HDU 2602 Bone Collector(01背包)

Bone CollectorProblem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he we

2015-10-02 20:36:49 323

原创 POJ 2187 Beauty Contest(旋转卡壳)

Beauty ContestDescriptionBessie, 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 <=

2015-10-02 12:54:34 999

原创 POJ 3714 Raid(求两集合之间的最近点对)

RaidDescriptionAfter successive failures in the battles against the Union, the Empire retreated to its last stronghold. Depending on its powerful defense system, the Empire repelled the six

2015-09-28 17:22:34 932

原创 HDU 1007 Quoit Design(最近点对)

Quoit DesignProblem DescriptionHave you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircled awarded.In the field of Cyb

2015-09-23 22:16:29 662

原创 自我探讨 国王和狱吏(合数)

课堂上老师提到的一个问题:   某国王对囚犯进行大赦,让一狱吏n次通过一排锁着的n间牢房,每通过一次,按所定规则转动n间牢房中的某些门锁, 每转动一次, 原来锁着的被打开, 原来打开的被锁上;通过n次后,门锁开着的,牢房中的犯人放出,否则犯人不得获释。    转动门锁的规则是这样的,第一次通过牢房,要转动每一把门锁,即把全部锁打开;第二次通过牢房时,从第二间开始转动,每隔一间转动一次;第k

2015-09-23 00:21:21 1089

原创 HDU 4001 To Miss Our Children Time(DAG上的DP)

To Miss Our Children TimeProblem DescriptionDo you remember our children time? When we are children, we are interesting in almost everything around ourselves. A little thing or a simple game wil

2015-09-22 20:52:50 564

原创 NYOJ 16 矩形嵌套(DAG上的DP)

矩形嵌套描述有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a输入第一行是一个正正数N(0样例输入1 10 1 2 2 45 86 107 9 3 15 8 12 10 9 72 2 样例输出5 【思路分析】

2015-09-21 20:53:20 494

原创 HDU 5438 Ponds(拓扑排序 + DFS)

PondsProblem DescriptionBetty 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 valuev.

2015-09-19 09:55:31 557

原创 HDU 1207 汉诺塔II(递推)

汉诺塔IIProblem Description经典的汉诺塔问题经常作为一个递归的经典例题存在。可能有人并不知道汉诺塔问题的典故。汉诺塔来源于印度传说的一个故事,上帝创造世界时作了三根金刚石柱子,在一根柱子上从下往上按大小顺序摞着64片黄金圆盘。上帝命令婆罗门把圆盘从下面开始按大小顺序重新摆放在另一根柱子上。并且规定,在小圆盘上不能放大圆盘,在三根柱子之间一回只能移动一个圆盘。有预言说

2015-09-17 11:11:37 478

原创 UVA 10881 Piotr's Ants

Piotr's AntsPiotr likes playing with ants. He hasn of them on a horizontal poleL cm long. Each ant is facing either left or right and walks at a constant speed of 1 cm/s. When two ants bump into

2015-09-16 22:23:23 330

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

TravelProblem DescriptionJack likes to travel around the world, but he doesn’t like to wait. Now, he is traveling in the Undirected Kingdom. There aren cities and m bidirectional roads con

2015-09-15 22:12:30 614

原创 POJ 3130 How I Mathematician Wonder What You Are!(半平面交求多边形的核)

How I Mathematician Wonder What You Are!DescriptionAfter counting so many stars in the sky in his childhood, Isaac, now an astronomer and a mathematician uses a big astronomical telescope

2015-09-12 21:05:34 713

原创 UVA 11300 Spreading the Wealth (数学推导)

ProblemA Communist regime is trying to redistribute wealth in a village. They have have decided to sit everyone around a circular table. First, everyone has converted all of their properties to coin

2015-09-11 17:58:54 362

原创 HDU 1671 Phone List(字典树)

Phone ListProblem 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

2015-09-11 16:54:07 351

原创 FZU 2197 最小花费

Problem 2197 最小花费 Problem Description给一个长度为n(n Input第一行一个整数T(1 Output最小花费。 Sample Input2121100120011 Sample Output03【思路分析】   该题贪心的策略就是优先处理最后一个1和最前一

2015-08-29 11:16:36 536

原创 POJ 1556 The Doors(判断线段相交 && 最短路)

The DoorsDescriptionYou 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 in

2015-08-29 00:12:43 415

原创 ZOJ 3778 Talented Chef

Talented ChefTime Limit: 2 Seconds      Memory Limit: 65536 KB As we all know, Coach Gao is a talented chef, because he is able to cookM dishes in the same time. Tonight he is going to hav

2015-08-27 11:11:04 395

原创 POJ 3264 Balanced Lineup(RMQ)

Balanced LineupDescriptionFor 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 wit

2015-08-26 11:25:15 315

原创 NYOJ 119 士兵杀敌(三)(RMQ)

士兵杀敌(三)时间限制:2000 ms  |  内存限制:65535 KB难度:5 描述南将军统率着N个士兵,士兵分别编号为1~N,南将军经常爱拿某一段编号内杀敌数最高的人与杀敌数最低的人进行比较,计算出两个人的杀敌数差值,用这种方法一方面能鼓舞杀敌数高的人,另一方面也算是批评杀敌数低的人,起到了很好的效果。所以,南将军经常问军师小工第i号士兵到第j号士兵中,杀敌数最高的人与杀敌数

2015-08-26 11:08:23 465

原创 HDU 2068 RPG的错排(错排+排列组合)

RPG的错排Problem Description今年暑假杭电ACM集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,G是月野兔;......可怜的野骆驼第六次终于把RPG分清楚了。由于RPG的

2015-08-25 10:45:44 566

原创 POJ 1410 Intersection(判断线段和矩形是否相交)

IntersectionDescriptionYou are to write a program that has to decide whether a given line segment intersects a given rectangle.An example:line: start point: (4,9)end point: (11,2)rec

2015-08-24 11:44:01 619

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

Intersecting LinesDescriptionWe 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 beca

2015-08-23 11:12:54 634

原创 POJ 3304 Segments(判断线段和直线是否相交)

SegmentsDescriptionGiven 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 se

2015-08-22 17:26:48 482

原创 HDU 1260 Tickets

TicketsProblem DescriptionJesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is wandering when c

2015-08-18 11:04:10 365

原创 POJ 2318 TOYS(点与凸多边形的位置关系)

TOYSDescriptionCalculate 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

2015-08-17 20:09:22 443

原创 HDU 5017 Ellipsoid(模拟退火)

EllipsoidProblem DescriptionGiven a 3-dimension ellipsoid(椭球面)your task is to find the minimal distance between the original point (0,0,0) and points on the ellipsoid. The distance betwe

2015-08-17 11:30:45 507

原创 HDU 2717 Catch That Cow

Catch That CowProblem DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and

2015-08-08 00:31:35 380

原创 HDU 1874 畅通工程续(最短路)

畅通工程续Problem Description某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。 Input本题目包含多组数据,请处理到文件

2015-08-07 22:55:27 2738

空空如也

空空如也

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

TA关注的人

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