
思维
AC-NEWBIE
得之淡然 失之坦然
展开
-
UVALive-7374-Racing Gems(最长上升子序列O(n*logn))
题目链接:点击打开链接题目大意:现有一个长为h(竖直方向),宽为w(水平方向)的跑道,跑道上有一些宝石, 给出每一个宝石的坐标。你可以从起点线的任何一个位置(x,0)出发,出发后在竖直方向上有一个恒定的速度v,水平方向上的速度你可以在任意时刻控制在(-v/r~v/r)之间的任何一个值(给出r的值,不给出v的值),当你到达终点线时,移动结束。求你从起点线出发最多可以获得多少宝石。解题思路原创 2017-09-05 17:54:18 · 321 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第二场)-J-farm
(一)题面:题目描述 White Cloud placed n containers in sequence on a axes. The i-th container is located at x[i] and there are a[i] number of products in it.White Rabbit wants to buy some products. The pr...原创 2018-07-23 10:54:41 · 452 阅读 · 0 评论 -
POJ-2053-Square(费马点+思维)
(一)题面:DescriptionGiven a square at [0, 1] * [0, 1] that has N points ( P1, P2, ..., PN ) in the square (you may assume that different points can be at the same position), we can connect the N points a...原创 2018-05-19 12:46:17 · 1079 阅读 · 0 评论 -
马的哈密尔顿回路(骑士周游)问题(+贪心优化)
(一)问题大意: 这是一个很经典的问题,给定一个n*n的棋盘,一个马从任意位置出发,按照马移动的规则,在不重复走任意一个点的前提下走完所有点,即跳n*n步以后需要遍历了整个棋盘。(二)问题分析: 1、按照常规的思路,直接回溯搜索求可行解:棋盘规模小的时候可以得到结果,当n>8时就难以得到结果了。所以在各个OJ上看到的一般都是限制在n<=8的条件下求解。 ...原创 2018-05-12 20:50:54 · 3869 阅读 · 0 评论 -
第五场-D-Space Golf
题面链接:点击打开链接(一)题面: DescriptionYou surely have never heard of this new planet surface exploration scheme, as it is being carried out in a project with utmost secrecy. The scheme is expected to c...原创 2018-05-10 18:44:03 · 305 阅读 · 2 评论 -
第三场-D-Partition
题目链接:点击打开链接(一)题面:DescriptionThe Ents are known as the shepherds of the forest. Treebeard, the oldest living Ent in Middle Earth, needs to determine which trees he is to shepherd and which原创 2018-04-20 13:07:49 · 361 阅读 · 0 评论 -
第一场-C-Card Hand Sorting
题目链接:点击打开链接(一)题面:DescriptionWhen dealt cards in the card game Plump it is a good idea to start by sorting the cards in hand by suit and rank. The different suits should be grouped and the原创 2018-04-17 01:03:28 · 372 阅读 · 0 评论 -
第一场-K-Keeping the Dogs Apart
Despite the unfortunate incident last summer, which resulted in ten little puppies, you have been tasked with taking care of your neighbors’ dogs again. Shadow and Lydia may be very cute mutts, but this year you have strict instructions to walk them one by原创 2018-04-08 00:19:07 · 456 阅读 · 0 评论 -
第一场-H - Highest Tower
H-Highest TowerOni loved to build tall towers of blocks. Her parents were not as amused though. They were on the verge of going crazy over that annoying loud noise when- ever a tower fell to the ground, not to mention having to pick up blocks from the flo原创 2018-04-09 15:27:20 · 250 阅读 · 0 评论 -
UVALive-7357-Pyro Tubes
题目链接:点击打开链接题目大意:给定一个单调递增的数字序列,求每一个数字与其后面的数字中用二进制串表示时最多只有两个位置不同的数的数目。解题思路:这个题显然可以想到两种思路:一:对于每一个数依次判断其后面的数是否满足条件,而总个数有2.5X1e5,显然TLE;二:对于每一个数求:满足用二进制串表示时最多只有两个位置不同的数,然后判断这个数是否在给出的序列中,求和。因为用二进原创 2017-09-08 20:32:24 · 256 阅读 · 0 评论 -
UVALive - 7998-Election
题目链接:点击打开链接题目大意:有n个人为两个候选人(A,B)投票,每人只能投一票,当某人获得的票数多余总票数一半时则获胜,当前已知部分人投票的结果,给定一个概率P,判断A获胜的概率是否大于P。解题思路:一:A不能获胜与A一定获胜这两种情况可以直接判断出来。二:计算当前A的获胜概率P(A),与P作比较。计算A要获胜还至少需要的票数x与当前还剩余可投的票数N,那么当A获得的票数在原创 2017-09-23 21:18:54 · 173 阅读 · 0 评论 -
2018 Multi-University Training Contest 1-B-Balanced Sequence
(一)题面:Problem DescriptionChiaki has n strings s1,s2,…,sn consisting of '(' and ')'. A string of this type is said to be balanced:+ if it is the empty string+ if A and B are balanced, AB is balan...原创 2018-07-24 16:53:02 · 239 阅读 · 0 评论