![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 63
xushenbao_123
一个技能树点歪的ACMER
展开
-
LEETCODE 48 672. Bulb Switcher II
/*2017-09-03看完大佬的代码发现这题其实非常简单粗暴的思路实际上每一种方案都是做或者不做,总共16种方案于是我们枚举这16种方案,先验证是否可行,然后由于n长度的问题,不一定每一种方案都是不同的结果,所以再把所有方案实施一遍放到set里。*/#define change s[i]=='0'?'1':'0'class Solution {public: int flip原创 2017-09-03 20:51:48 · 673 阅读 · 0 评论 -
664Strange Printer
题目描述: LeetCode 664. Strange PrinterThere is a strange printer with the following two special requirements:The printer can only print a sequence of the same character each time. At each turn, the prin原创 2017-09-04 00:31:25 · 274 阅读 · 0 评论 -
leetcode 801.Minimum Swaps To Make Sequences Increasing
链接:https://leetcode.com/contest/weekly-contest-76/problems/minimum-swaps-to-make-sequences-increasing/题意:给两个等长度数组,问交换最少次数使两个数组都变为升序,最少几次?思路:很明显的动规,就是分类麻烦一点点,就是强怼。 针对i和i+1位置有两种情况: 两个数组都已经满足升序,即A[i]cla原创 2018-03-19 22:23:30 · 482 阅读 · 0 评论