Codeforces Round #821(Div.2) (A-C) 题解】的更多相关文章

Codeforces Round #821(Div.2) (A-C) A.Consecutive Sum 大致题意 给定一组共 n 个数据 ,如果俩个数的下标在 mod k 意义下同余,则可以交换a[I] 和 a[j] ,求操作后一段连续的数的和的最大值. 基本思路 本题属于水题,因为 t 和 n 都比较小,所以可以直接暴力的把所有最大的数移到最前面的 k 个位置,即从最后 k 个数开始向前枚举比较,做冒泡排序即可. 代码 #include<bits/stdc++.h> using names…
这场比赛的出题人挺有意思,全部magic成了青色. 还有题目中的图片特别有趣. 晚上没打,开virtual contest打的,就会前三道,我太菜了. 最后看着题解补了第四道. 比赛传送门 A. Angry Students 题目大意:有t队学生,每个学生有两种状态,生气(A)或不生气(P).(话说为什么生气的戴着圣诞帽哇)所有生气的人都会往前一个人丢雪球,被丢到的人也会变得生气,也会丢雪球.问你每队人中最后一个学生变得生气的时刻. 这题就是统计最长的连续的'P'当然前提是左边有生气的人. 代码…
Codeforces Round #198 (Div. 2) 昨天看到奋斗群的群赛,好奇的去做了一下, 大概花了3个小时Ak,我大概可以退役了吧 那下面来稍微总结一下 A. The Wall Iahub and his friend Floyd have started painting a wall. Iahub is painting the wall red and Floyd is painting it pink. You can consider the wall being mad…
[Codeforces Round #672 (Div. 2) A - C1 ] 题目链接# A. Cubes Sorting 思路: " If Wheatley needs more than \(\frac{n \cdot (n-1)}{2}-1\) exchange operations, he won't do this boring work." 例如:5,4,3,2,1 我们需要移动4+3+2+1=10次,也就是\(\frac{n \cdot (n-1)}{2}\)次,所以…
链接:https://codeforces.com/contest/1293 A. ConneR and the A.R.C. Markland-N 题意:略 思路:上下枚举1000次扫一遍,比较一下上下最近的房间 AC代码: #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<map> #include<utility> #…
contest链接: https://codeforces.com/contest/1282 A. Temporarily unavailable 题意: 给一个区间L,R通有网络,有个点x,在x+r和x-r范围内,没有网络,问在这个区间上有网络的长度范围 思路:枚举区间覆盖情况,注意细节 AC代码: #include<iostream> #include<string> #include<vector> #include<cstring> #include…
contest链接:https://codeforces.com/contest/1283 A. Minutes Before the New Year 题意:给一个当前时间,输出离第二天差多少分钟 思路:略 AC代码: #include<iostream> #include<vector> #include<algorithm> #include<cmath> #include<cstring> using namespace std; ; ;…
题目: http://codeforces.com/contest/1011/problem/D This is an interactive problem. Natasha is going to fly to Mars. Finally, Natasha sat in the rocket. She flies, flies... but gets bored. She wishes to arrive to Mars already! So she decides to find som…
题目 http://codeforces.com/contest/1011/problem/C Natasha is going to fly on a rocket to Mars and return to Earth. Also, on the way to Mars, she will land on n−2n−2 intermediate planets. Formally: we number all the planets from 11 to nn. 11 is Earth, n…
接着是C,D的题解 C. Tourist Problem Iahub is a big fan of tourists. He wants to become a tourist himself, so he planned a trip. There are n destinations on a straight road that Iahub wants to visit. Iahub starts the excursion from kilometer 0. The n destina…