2019暑假比赛补题
九羽-
日有所进,月有所变,终有所成。
展开
-
G - Research Productivity Index ( 数学期望 + DP )
G - Research Productivity Index ( 数学期望 )题意:小明手里有n份代码,每一份代码都有一个ac成功率。f值等于,其中a为ac的数量,b为总提交数,比如交了5份4份ac, f = ≈3.031433 , 最后问交几份怎么交期望值最大。Sample Input :530 50 70 60 90Sample Output2.2208...原创 2019-10-27 21:01:28 · 418 阅读 · 0 评论 -
Choose and divide ( 爆long long处理 )
Choose and divide ( 爆long long处理 )题意:给出p,q,r,s;然后按照所给公式算出C(p,q)和C(r,s);输出C(p,q)/C(r,s);思路:首先直接算的话会超出范围;我们通过看公式可以知道,分子分母个数是一样的;比如10! / (5!*(10 - 5)!)那么我们可以选择把5!和10!对消,或者(10 - 5)!和10!对消;反正...原创 2019-10-26 21:44:56 · 122 阅读 · 0 评论 -
A. Maximum Element In A Stack (模拟堆栈)
A. Maximum Element In A Stack (模拟堆栈)题目链接:https://nanti.jisuanke.com/t/41285思路:把题目中说的代码复制过来,在push和pop操作时,记录一个堆栈每一层的最大值,并根据题目要求计算答案。注:有一点是在运算过程p*i超int了, 在p*i的前面加一个1LL*就A了, ans=(ans^( 1LL*p*i ));...原创 2019-08-31 19:17:56 · 479 阅读 · 0 评论 -
B. Rolling The Polygon(几何+余弦定理)
B. Rolling The Polygon(几何+余弦定理)题目链接:https://nanti.jisuanke.com/t/41286题意:一个n边形内含有一点p,多边形从一条边开始沿其延长线旋转一周,问p的运动长度。思路:容易推出, p点每一小段的弧长都是一本分圆周运动, 求出多边形每个角的大小和p点距离每个角的距离就能得出答案。知道三个点的坐标求角度, 用余弦定理...原创 2019-08-31 19:24:46 · 344 阅读 · 0 评论 -
D. Take Your Seat (概率)
D. Take Your Seat (概率)题目链接:https://nanti.jisuanke.com/t/41288题意:第一问:有n个乘客坐飞机,每个人都有一张票, 现在第一个上机的人把票弄丢了, 他就随便找了一个座位坐下来,如果后面的乘客发现自己的座位被别人坐了,就会在剩下空的座位随便挑一个坐。 问最后一个人正确坐到自己坐位的概率是多少?第二问:有m个乘客坐飞机,...原创 2019-08-31 19:38:30 · 366 阅读 · 0 评论 -
A - I Count Two Three ( 打表+二分 )
A - I Count Two Three ( 打表+二分 )I will show you the most popular board game in the Shanghai Ingress Resistance Team.It all started several months ago.We found out the home address of the enlighte...原创 2019-09-05 10:28:55 · 193 阅读 · 0 评论 -
Halfway ( 二分 )
Halfway ( 二分 )A friend of yours has written a program that compares every pair of a list of items. Withnitems,it works as follows. First, it prints a 1, and it compares item 1 to items 2,3,4, . ....原创 2019-09-06 15:42:19 · 458 阅读 · 0 评论 -
Honk's pool ( STL multiset )
Honk's pool ( STL multiset )multiset 和 set 唯一的不同是 set 中一个值只能出现一次,而multiset中一个值可以出现多次。题目链接:https://nanti.jisuanke.com/t/41406题意: n个数,每次挑一个最大的减一,挑一个最小的加一, 问k次操作后最大值和最小值差多少。思路:纯模拟。学习一下multiset...原创 2019-09-14 20:02:44 · 153 阅读 · 0 评论 -
I - Bricks ( 贪心模拟 )
I - Bricks ( 贪心模拟 )题意:给一个字符串,1B 3W 2B 代表BWWWBB。 问这个字符串最多能分成几部分,使得每一部分B和W的比例和总串一样。思路:贪心思想,从头开始往后分, 满足一个公式, 我们for循环每一块的时候判断要么nowb增加,要么noww增加,左边的值是固定的,这样就可以判断如果在增加前不符合条件,在增加的过程中等于了条件那么就是可以的, 注意...原创 2019-09-24 11:11:37 · 224 阅读 · 0 评论 -
J - Jokewithpermutation ( DFS )
J - Jokewithpermutation ( DFS )题意:右边有n个数,从1到n, 现在把他们之间的空格去掉得到左边的字符串, 现在给出左边的字符串,求右边分隔开的数列。思路: DFS, 见代码代码:#include <bits/stdc++.h>using namespace std;int via[160];char a[155];i...原创 2019-09-26 10:39:21 · 287 阅读 · 0 评论 -
M - Maratona Brasileira de Popcorn( 二分答案 )
M - Maratona Brasileira de Popcorn( 二分答案 )题意:输入三个数n,c,t 。 桌子上有n堆爆米花,每一堆有ai个, 现在有c个人一起吃爆米花,每人每分钟最多能吃t个爆米花,但有两个规定:1.一堆爆米花只能一个人吃, 2.每个人只能吃连续的若干堆爆米花。思路:二分天数,然后暴力尝试。注:一般来说, 若题目要求输出一个确定的数( 比如最小天...原创 2019-09-28 20:16:55 · 670 阅读 · 0 评论 -
A - Artwork ( 并查集 )
A - Artwork ( 并查集 )题意:在一个n*m的房间里,有k个摄像头,每个摄像头给出坐标(x,y)和范围半径r , 小偷在左下角, 宝藏在右上角,问小偷能否成功偷到宝藏。思路:可以把房间放到x-y坐标轴的第一象限, 这样小偷在(0,0) 宝藏zai(n,m), 我们先记录每一个圆和四周墙壁的相交情况,再通过并查集来确定圆和圆的关系, 如果圆1和上边界相交,圆2和下...原创 2019-09-28 20:29:02 · 400 阅读 · 0 评论 -
A - Abbreviation (字符串模拟)
A - Abbreviation (模拟)题目链接:http://codeforces.com/gym/101190/attachments题意:有一些单词组成的句子,把它们改变一下形式输出。比如:This is ACM North Eastern European Regional Contest,改成:This is ACM NEERC (North Eastern Eur...原创 2019-08-22 20:55:58 · 194 阅读 · 0 评论 -
Teamwork (基础dp)
Teamwork (基础dp)Teamwork is highly valued in the ACM ICPC. Since the beginning, the ICPC has distinguished itself from other programming contests in that teamwork is a key factor.The University o...转载 2019-08-19 20:46:19 · 398 阅读 · 0 评论 -
Maximum Median(二分)
You are given an arrayaaofnnintegers, wherennis odd. You can make the following operation with it:Choose one of the elements of the array (for exampleaiai) and increase it by11(that is, rep...原创 2019-08-06 19:58:05 · 490 阅读 · 0 评论 -
Journey to the “The World’s Start”(二分+dp+单调队列)
Journey to the “The World’s Start”(二分+dp+单调队列)推荐阅读:https://www.cnblogs.com/hua-dong/p/9460761.html题意:现在有1,2,3...N这N个站, 给定限定时间Limt, N-1种票的价格, 分别对应一个最远距离, 叫你选择一种票, 满足可以在规定时间到达N站台,而且价格最低...转载 2019-07-30 16:05:20 · 204 阅读 · 0 评论 -
Distribution in Metagonia(按条件拆分整数)
Distribution in Metagonia(按条件拆分整数)推荐阅读:https://blog.csdn.net/snowy_smile/article/details/49852091最核心的一句话:if a family receives at least one cube, every prime divisor of the number of cubes ...原创 2019-07-30 19:05:03 · 278 阅读 · 0 评论 -
I - Ultimate Army( 堆栈模拟题意 )
I - Ultimate Army( 堆栈模拟题意 )3 days, that's how much time the king gave Daffy to find him the ultimate army organization plan before he cuts his head off.2 days already passed with no progress, b...原创 2019-07-26 16:00:38 · 231 阅读 · 0 评论 -
K - Birthday Puzzle ( DFS遍历数组元素的所有组合情况 )
K - Birthday Puzzle ( DFS遍历数组 )Today is the Birthday of a beautiful girl, she's happy and she's telling her friends loudly to bring her birthday gifts. One of her best friends who is fond of puzzl...原创 2019-07-26 17:31:50 · 530 阅读 · 0 评论 -
Zigzag (最长交替子序列)
Zigzag (最长交替子序列)Your Ph.D. thesis on properties of integer sequences is coming along nicely. Each chapter is on a different type of sequence. The first covers arithmetic sequences. Subsequently yo...原创 2019-07-26 20:05:47 · 1292 阅读 · 0 评论 -
E - 【粉色】浣熊市下水道 (BFS,可移动障碍物)
E - 【粉色】浣熊市下水道 (BFS,可移动障碍物)在浣熊市狭窄的下水道中,伴随着枪响,那颗本应射中艾达的子弹被浣熊市新晋警察里昂挡了下来。艾达无法理解里昂为什么会为她挡下这发子弹,但她还是将里昂拖到了安全的地方并用绷带治疗了里昂。由于任务在身,艾达不得已丢下了昏迷的里昂,继续去追击G病毒的创造者。当里昂逐渐恢复意识,他发现自己已经是弹尽粮绝,尽管下水道中拥有大量的感染者,但他还是想追上...原创 2019-07-27 10:53:54 · 193 阅读 · 0 评论 -
F - Tickets Gym - 101911F (思维)
F - Tickets Gym - 101911F (思维)Lastnndays Monocarp used public transport to get to the university. He received a ticket with numbertitiduring theii-th day.Tickets' numbers are six digit non-...转载 2019-08-01 13:21:44 · 343 阅读 · 0 评论 -
A - Coffee Break(优先队列)
A - Coffee Break(优先队列)Recently Monocarp got a job. His working day lasts exactlymmminutes. During work, Monocarp wants to drink coffee at certain moments: there arennminutesa1,a2,…,ana1,a2,…,...原创 2019-08-01 15:17:21 · 591 阅读 · 0 评论 -
URAL - 2014 (巧用线段树)
C - Zhenya moves from parents (巧用线段树)Zhenya moved from his parents’ home to study in other city. He didn’t take any cash with him, he only took his father’s credit card with zero balance on it. Zh...转载 2019-08-08 10:15:34 · 176 阅读 · 0 评论 -
Barbells(三进制枚举+set)
(三进制枚举+set)推荐阅读原文:https://blog.csdn.net/Code92007/article/details/86772413:题意:哑铃,有n个重量的杆,m个重量的盘。当左右重量相等时算作哑铃,问有几种可能重量的哑铃。思路:三进制枚举,第i位为1代表给左边加第i块铁片,为2代表给右边加该铁片,为0代表不加这样所有的集合都...转载 2019-07-28 20:52:33 · 713 阅读 · 0 评论 -
K - Video Reviews(二分+贪心)
The studio «Lodka Gaming» is engaged in advertising of their new game «.C.O.N.T.E.S.T: Unexpected Behaviour». The studio's marketer is planning to communicate withnvideobloggers one by one (in the p...原创 2019-08-06 16:45:08 · 240 阅读 · 0 评论 -
F - Minimum Sum of Array(素数筛)
F - Minimum Sum of Array(素数筛)You are given an arrayaconsisting ofnintegersa1, ..., an. In one operation, you can choose2elementsaiandajin whichaiis divisible byajand transformaito...原创 2019-07-30 14:51:47 · 188 阅读 · 0 评论