Codeforces#681 (div.2)D. Extreme Subtraction(差分序列,構造)
D. Extreme Subtraction
time limit per test2 seconds
memory limit per test256 megabytes
You are given an array a of
相關推薦
Codeforces#681 (div.2)D. Extreme Subtraction(差分序列,構造)
D. Extreme Subtraction time limit per test2 seconds memory limit per test256 megabytes You are given an array a of
Codeforces #663 div.2 D
題目 A binary matrix is called good if every even length square sub-matrix has an odd number of ones.
Three Sequences(差分序列構造)
題目連結:D. Three Sequences 題意:給你一個長度為n的序列a,你要把每一個ai拆成bi + ci,形成兩個長度為n的序列b和c,並且要保證b序列單調非遞減,c序列單調非遞增,然後進行m次操作,每次操作使得a序列的[l, r]區
Codeforces Round 655 (Div. 2) D
題意 給你一個長度為 n 的陣列(保證 n 為奇數),陣列頭尾相連變成一個環。現在你需要對這個環進行多次如下操作直到陣列中只剩下一個數,使得最後這個數最大。
Educational Codeforces Round 89 (Rated for Div. 2)D. Two Divisors 線性篩質因子
題目連結:D:Two Divisors 題意: 給你n個數,對於每一個數vi,你需要找出來它的兩個因子d1,d2。這兩個因子要保證gcd(d1+d2,vi)==1。輸出的時候輸出兩行,第一行輸出每一個數vi對應的第一個因子d1,第二行對應位置
Codeforces Round #658 (Div. 2) D. Unmerge(dp)
題目連結:https://codeforces.com/contest/1382/problem/D 題意 給出一個大小為 $2n$ 的排列,判斷能否找到兩個長為 $n$ 的子序列,使得二者歸併排序後能夠得到該排列。
Codeforces Round #658 (Div. 2)D(01揹包)
題:https://codeforces.com/contest/1382/problem/D 題意:給定隨意倆個數組的合併規則,每次取倆個數組第一個的最小值,直至倆陣列為空.。給定目標陣列(1~n出現1次)問能不能2個數組合併成目標陣列
Educational Codeforces Round 88 (Rated for Div. 2) D、Yet Another Yet Another Task
題意: 給你一個含n個數a1,a2...an的陣列,你要找到一個區間[l,r],使得al+a(l+1)+...+a(r-1)+ar減去max(al,a(l+1),...,a(r-1),ar)的值儘可能大
Codeforces Round #658 (Div. 2) D. Unmerge (思維,01揹包)
題意:有兩個陣列\\(a\\)和\\(b\\),每次比較它們最左端的元素,取小的加入新的陣列\\(c\\),若\\(a\\)或\\(b\\)其中一個為空,則將另一個全部加入\\(c\\),現在給你一個長度為\\(2n\\)的陣列\\(c\\),問是否能有兩個長度
Codeforces Round #659 (Div. 2) D GameGame
題意: 給一個數組 兩個人輪流從裡面取數,取了的數不能再取 每個人有一個value
Educational Codeforces Round 56 (Rated for Div. 2) D. Beautiful Graph (二分圖染色)
題意:有\\(n\\)個點,\\(m\\)條邊的無向圖,可以給每個點賦點權\\({1,2,3}\\),使得每個點連的奇偶不同,問有多少種方案,答案對\\(998244353\\)取模.
Codeforces Round #658 (Div. 2) D. Unmerge
題目連結:https://codeforc.es/contest/1382/my 題意:給一段長為2n 的排列方式(permutation) 問 能否找到對應的 兩段n 組成的 序列 構成這段排列方式
Codeforces Round #660 (Div. 2) D. Captain Flint and Treasure
題目連結:https://codeforc.es/contest/1388/problem/D 題意:一種操作為 選一個下標 使得ans+=a[i] 且 把a[i]+到a[b[i]]中 要求每個下標都進行一種這樣的操作,問怎麼樣的操作順序才能使得ans最大
Codeforces Round #658 (Div. 2) D
D. Unmerge 題目連結 題目: 判斷是否存在長都為n的兩個陣列 a[ ] , b[ ] 每次 : 如果 a 的第一個元素 小於 b的第一個元素
Codeforces Round #662 (Div. 2) D. Rarity and New Dress 預處理的DP
題意:問給定的矩陣中形如綠色的塊的個數。 紅色是不合法的。第一個紅沒有全是同樣的字母。第二個紅越界。第三個紅不是斜的45度
Codeforces Round #664 (Div. 2) D. Boboniu Chats with Du
傳送門:cf1395D 題意 給定一個長度為n的陣列a[i]為當天說話的有趣值,如果a[i]>m,那麼在 i 之後有d天不能說話。否則可以每天都說話。找到一個排列使得n天有趣值總和最大,問有趣值總和的最大值是多少。
Educational Codeforces Round 93 (Rated for Div. 2) D. Colored Rectangles
D. Colored Rectangles 原題連結: https://codeforces.ml/contest/1398/submission/89947207 題目大意:
Codeforces Round #665 (Div. 2) D - Maximum Distributed Tree dfs貢獻記錄
題意: t組輸入,每組資料中n個節點構成一棵樹,然後給你n-1條邊。給你一個m,然後給你m個k的素數因子,你需要給這n-1條邊都賦一個權值,這n-1條邊的權值之積應該等於k。如果k的素數因子數量小於n-1,那可以使用1來填
Codeforces Round #665 (Div. 2) D. Maximum Distributed Tree
題目連結:https://codeforces.ml/contest/1401/problem/D 題意:給每條邊標記一個數,要求用的1儘量少,並且乘積之和為k要求的是 1 到2 3……n , 2到 3,4…… n n-1到n 的簡單路徑經過的邊
Codeforces Round #665 (Div. 2) D. Maximum Distributed Tree (貪心 + dfs)
** 注意sort時不要取模!!!!!** #include<iostream> #include<cstdio> #include<cstring>