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 ...
D. K Game time limit per test seconds memory limit per test megabytes inputstandard input outputstandard output Alice and Bob play a game. There is a paper strip which is divided into n cells numbered ...
2019-07-15 01:51 0 469 推薦指數:
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 ...
鏈接: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\) 的大括號,后面 ...
A - Two Rival Students 題意:共n個人排一排,兩個人,位於a,b,相鄰位置交換至多x次,最大化abs(a-b)的值。 題解:每次交換至多+1,不能超過n-1。 B - ...
題目鏈接: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 ...
A. Regular Bracket Sequences 思路: 枚舉,我們讓出現先連續左括號和出現右括號的數量一一對應,我們從連續出現n個左括號開始枚舉,下一次枚舉是先連續出現n-1個左括號,在 ...
傳送門 視頻題解 A. Shovels and Swords 貪心。每次盡可能取較多那一邊即可。 寫法上可以加速,\((2,1),(1,2)\)這種可以看作\((3,3)\),只取\((1,2)\ ...