
分治
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
【分治】01串
在第一行我们写上一个0。接下来的每一行,将前一行中的0替换为01,1替换为10。 给定行数N和序数K,返回第N行中第K个字符。(K从1开始) 输入格式: 输入在一行中给出2个整数N和K。 N的范围[1,30]K的范围[1,2(N−1)] 输出格式: 对每一组输入,在一行中输出第N行中第K个字符。 输入样例1: 1 1 结尾无空行 输出样例1: 0 结尾无空行 输入样例2: 2 1 结尾无空行 输出样例2: 0 结尾无空行 输入样例3: 2 2 结尾无空行 .原创 2021-12-12 19:57:15 · 455 阅读 · 0 评论 -
*【 POJ - 1007 】DNA Sorting(枚举,类似三元组找第二元问题)
题干: One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the letter sequence ``DAABEC'', this measure is ...原创 2019-10-18 23:40:42 · 196 阅读 · 0 评论 -
*【CodeForces - 768B】Code For 1 (分治策略,模拟二分思想,模拟线段树思想)
题干: Jon fought bravely to rescue the wildlings who were attacked by the white-walkers at Hardhome. On his arrival, Sam tells him that he wants to go to Oldtown to train at the Citadel to become a mae...原创 2018-10-30 22:04:33 · 438 阅读 · 0 评论 -
*【2019牛客暑期多校训练营(第三场)- G】Removing Stones(分治)
题干: 链接:https://ac.nowcoder.com/acm/contest/883/G 来源:牛客网 Summer vacation is coming and Mark has returned home from his university having successfully survived the exam week. Today, he is very bored...原创 2019-08-22 14:35:18 · 335 阅读 · 0 评论