摘要:
链接 [https://codeforces.com/contest/985/problem/B] 题意 给你n,m,分别是n个开关,m个灯 给一个n m的字符矩阵aij=1,表示i可以控制j这个灯 为你能否去掉一个开关使得,所有灯都亮,开始灯是暗的 分析 思维了, 统计第j个灯被多少个开关控制 每 阅读全文
摘要:
链接 [https://codeforces.com/contest/985/problem/A] 题意 给你一个偶数n,输入n/2个数,代表棋子的位置,有一个1 n的棋盘是黑白相间的 问你使得所有棋子在同一种颜色所需移动的最小步数 分析 先对所有棋子的位置排序 贪心枚举两种颜色都算在比较 代码 i 阅读全文
摘要:
链接 [https://codeforces.com/contest/985/problem/C] 题意 给你n,k,l,分别表示木桶数,一个木桶所需的 木块数,以及最大最小体积之差不超过l, 根据短板定律,的最大体积和 分析 就是很典型的贪心,先排序二分查找可能的最大的那个体积 eg:4 3 17 阅读全文