摘要: 传送门 题目: Dreamoon likes sequences very much. So he created a problem about the sequence that you can't find in OEIS: You are given two integers d,m fin 阅读全文
posted @ 2020-08-16 22:03 SummerMingQAQ 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 传送门 题目:给定一个数n,问(0~n)相邻两个数之间二进制位不同个数的总和。 思路:看出规律,把n转化为二进制,如果该二进制位处于第x位且为1,则它的贡献为2^(x) - 1,累加所有贡献即可。 1 #include<iostream> 2 #include<string> 3 #include< 阅读全文
posted @ 2020-08-16 15:20 SummerMingQAQ 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 传送门 题目:给定n个长度为m的"0""1"串,你可以改变任意一个位置的二进制,使得边长为偶数的任意一个子矩阵中"1"的个数为奇数,如果不可能输出"-1",可能的话,最少需要改变几个位置的二进制。 思路:硬想太难想。。。(对我来说),然后自己构造了下边长为2,4,6的矩阵,推出一个性质,边长为4的子 阅读全文
posted @ 2020-08-16 00:10 SummerMingQAQ 阅读(179) 评论(0) 推荐(0) 编辑