
都是套路
MU__LE
这个作者很懒,什么都没留下…
展开
-
搜索剪枝
George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks he had orig...原创 2018-08-18 15:36:06 · 215 阅读 · 0 评论 -
High Score
题解:平方增长更快些,所以大数据的情况下更适合全部累加到一个数上,小数据暴力枚举就行了;#include<iostream>#include<algorithm>using namespace std;typedef long long LL;const int maxn=1000;int T;LL a, b, c, d;LL ans;L...原创 2018-08-27 17:47:45 · 1083 阅读 · 0 评论 -
Boss Battle
题解:题目描述:有环形的n根柱子,只有一根柱子后面有boss,每次向一根柱子投一个炸弹,炸弹波及范围为那根柱子和相邻的柱子,若boss在这三根柱子后面,则boss被炸死,若boss没有被炸死,则boss会选择原地不动或者走到相邻的柱子,问最坏情况下要用多少个炸弹。显然:当n≤3时,答案是1。但n>3时,观察可得答案是n−2。因为在每次扔完炸弹后,第二次扔在那个炸弹的顺时针...原创 2018-08-27 16:51:12 · 260 阅读 · 0 评论 -
广搜
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there...原创 2018-08-17 16:42:06 · 187 阅读 · 0 评论 -
二分或者hash
The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0 . In the followin...原创 2018-08-17 14:44:08 · 212 阅读 · 0 评论 -
搜索剪枝
Given a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if t = 4, n = 6, and the list is [4, 3, 2, 2, 1, 1], then there ar...原创 2018-08-19 15:15:05 · 357 阅读 · 0 评论 -
单调队列
An array of size n ≤ 10 6 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each tim...原创 2018-08-16 21:12:31 · 112 阅读 · 0 评论 -
尺取法
Signals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going through a defiant phase: "But I want to use feet, no...原创 2018-08-16 20:14:59 · 126 阅读 · 0 评论 -
搜索剪枝
7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1 <= i <= M)层蛋糕是半径为Ri, 高度为Hi的圆柱。当i < M时,要求Ri > Ri+1且Hi > Hi+1。 由于要在蛋糕上抹奶油,为尽可能节约经费,我们希望蛋糕外表面(最下一层的下底面除外)的面积Q最小。 令Q = Sπ ...原创 2018-08-18 17:51:03 · 135 阅读 · 0 评论 -
Two strings
You are given two strings a and b. You have to remove the minimum possible number of consecutive (standing one after another) characters from string b in such a way that it becomes a subsequence of st...原创 2018-08-24 18:34:34 · 621 阅读 · 0 评论