B. Strange List 題目分析 題意:給你一個長度為n的數組和一個數字x,從第一個元素開始,如果改元素q能被x整除,那么將就在數組后面新增x個(q / x),直到遇到的元素不能被x整除,求最后數組的元素之和 讓我們從樣例開始入手分析:樣例中的第一個情況數組a為[12],x為2,數組 ...
You have n gifts and you want to give all of them to children. Of course, you don t want to offend anyone, so all gifts should be equal between each other. The i th gift consists of a i candies and b ...
2020-08-07 14:34 1 499 推薦指數:
B. Strange List 題目分析 題意:給你一個長度為n的數組和一個數字x,從第一個元素開始,如果改元素q能被x整除,那么將就在數組后面新增x個(q / x),直到遇到的元素不能被x整除,求最后數組的元素之和 讓我們從樣例開始入手分析:樣例中的第一個情況數組a為[12],x為2,數組 ...
D. 0-1 MST Ujan has a lot of useless stuff in his drawers, a considerable part of which are his mat ...
Young wilderness explorers set off to their first expedition led by senior explorer Russell. Explore ...
題目連接:https://codeforces.com/contest/1323/problem/B 題意:給一個大小為n的a數組,一個大小為m的b數組,c數組是二維數組c[i][j]=a[i]*b[j],問面積為k的矩形有幾個。 題解:先把k的所有因子存入一個數組里,然后遍歷因子,表示 ...
😢 😢 😢 題意:第 i 步可以挑一個數字加 i ,問你最少多少步能讓兩個數字相等 假設剛開始兩個數字相等,然后一個數字向前走了abs(b-a)步,由等差數列求和公式,這時候我們貪心的讓另外一個數字走大於等於abs(b - a)的最小步數,然后如果兩數相等必須滿足走的步數之和 ...
B. PIN Codes A PIN code is a string that consists of exactly 4 digits. Examples of possible PIN codes: 7013, 0000 and 0990. Please note that the PIN ...
B. Lipshitz Sequence Time Limit: 20 Sec Memory Limit: 256 MB 題目連接 http://codeforces.com/contest/601/problem/B Description A function is called ...
B. Rebranding The name of one small but proud corporation consists of n lowercase ...