2018ICPC青岛现场赛 重现训练】的更多相关文章

先贴代码,以及简要题解. 和一个队友下午双排打了一下,队友光速签到,我签的J被嫌弃写得慢以及演员...然后我秒出了E了思路然而难以置信这么简单的思路当时才过了十几个,于是发现D.F不是太好做.最后交了13发E才过,中间爆ll.memset超时..赛后补了F. 只贴我写的三个题. J: ZOJ 4067 题解:把所有0拿掉后贪心拿完前面的,然后再加上后面的最小值-1.改了三次在基佬紫帮助下才写对. #include<cstdio> #include<iostream> #includ…
A: 题目链接 :https://vjudge.net/contest/250823#problem/A 参考 : https://www.cnblogs.com/helenawang/p/5465481.html #include <cstdio> #include <cmath> #include <algorithm> using namespace std; ; int cmp(double x){ : (x>eps); } double pow2(dou…
题意:BaoBao正在进行在线考试(都是选择题),每个题都有唯一的一个正确答案,但是考试系统有m个bug(就是有m个限制),每个bug表示为第u个问题和第v个问题你必须选择相同的选项,题目问你,如果你修好了第i个bug,BaoBao最高可以取得多少分. 题目数量1e5BUG数量1e5(真多)答案范围1e5 思路:首先,如果出现了bug,导致{a1,a2,...,an}n个题目必须选择一样的结果,那么最高得分肯定是众数的出现次数.我们发现bug是具有传递性的,如果bug连成了一个环,而且你只修复其…
题意: 你的房子在0点,1,2,3,...,n(n<=1e5)点每个点都有一颗高度为0的花,浇一次水花会长a[i]. 你有一个机器人刚开始在你家,最多走m步,每一步只能往前走或者往后走,每走到一个地方除了房子都会给花浇水,问m步以后最低那朵花的高度最大是多少. 思路:二分,并且可以证明左右横跳(即这一个点不够我们就来回走一直到够高度为止). 需要注意步数用完直接break,每一朵花浇够次数立刻走向下一朵花(如果还有步数). 代码: #include<bits/stdc++.h> #def…
题面:http://acm.zju.edu.cn/contest-materials/qd2018/qd2018_problems.pdf 题意: n个骑士决斗K轮 要求是每个骑士只能跟另外一个骑士决斗一次 每轮必须有 n/2 场决斗 如果在某轮A和B单挑,C和D单挑 那么在下面的论场中必然有A和C单挑同时B和D单挑 思路: 用一个set存每个骑士还没单挑过的其他骑士编号,一个set存每轮还没有单挑过的骑士 先预处理第一轮的21436587······ 第一个骑士每轮单挑必然是单挑的轮数+1(如…
Travel There are nn planets in the MOT galaxy, and each planet has a unique number from 1 \sim n1∼n. Each planet is connected to other planets through some transmission channels. There are mm transmission channels in the galaxy. Each transmission cha…
Swap There is a sequence of numbers of length nn, and each number in the sequence is different. There are two operations: Swap the first half and the last half of the sequence (if nn is odd, the middle number does not change) Swap all the numbers in…
Tree Ming and Hong are playing a simple game called nim game. They have nn piles of stones numbered 11 to nn ,the ii-th pile of stones has a_iai​ stones. There are n - 1n−1 bidirectional roads in total. For any two piles, there is a unique path from…
Angel's Journey “Miyane!” This day Hana asks Miyako for help again. Hana plays the part of angel on the stage show of the cultural festival, and she is going to look for her human friend, Hinata. So she must find the shortest path to Hinata’s house.…
Tasks It's too late now, but you still have too much work to do. There are nn tasks on your list. The ii-th task costs you t_iti​seconds. You want to go to bed TT seconds later. During the TT seconds, you can choose some tasks to do in order to finis…