A - Two Rival Students 题意:共n个人排一排,两个人,位于a,b,相邻位置交换至多x次,最大化abs(a-b)的值。 题解:每次交换至多+1,不能超过n-1。 B - ...
D. Yet Another Monster Killing Problem You play a computer game. In this game, you lead a party of heroes, and you have to clear a dungeon with monsters. Each monster is characterized by its power . E ...
2019-11-14 19:33 0 396 推荐指数:
A - Two Rival Students 题意:共n个人排一排,两个人,位于a,b,相邻位置交换至多x次,最大化abs(a-b)的值。 题解:每次交换至多+1,不能超过n-1。 B - ...
Educational Codeforces Round 76 (Rated for Div. 2) E. The Contest(dp+线段树) 题目链接 题意: 给定3个人互不相同的多个数字,可以把数字移动给别人,问最少移动几次后可以使第一个人的数字为1~m1,第二个人m1~m2,第三个 ...
D. 1-2-K Game time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Alice and Bob play a game. ...
A. Prime Subtractiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inpu ...
链接:https://codeforces.com/contest/1359 A. Berland Poker 题意: 现在有$n$张牌,$m$张王,共有$k$个人,每个人分得$\frac{k}{n}$张牌,你的得分是你手中王牌的个数减去其余人中拥有最多王牌的个数,求最大得分 思路 ...
本场链接:Educational Codeforces Round 114 (Rated for Div. 2) A. Regular Bracket Sequences 由于只需要构造 \(n\) 种,所以构造第 \(i\) 的时候可以让最左端的是一个长度为 \(i\) 的大括号,后面 ...
题目链接:https://codeforces.com/contest/1469 A.Regular Bracket Sequence 题目大意:给你含有一个( 和一个 ),其他全是 ?的字符串,判断该字符串是否合法 题目思路:特判:①如果开头 )结尾( ,不合法②如果 ? 的个数是奇数 ...
Educational Codeforces Round 103 A. K-divisible Sum 题意 给定 n , k 构造出长度为 n 的正整数序列, 使得序列的和是 k 的倍数,求最大值的最小值 思路 当 \(n \le k\) 时候,答案是 \(\lceil \dfrac ...