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 ...