摘要:
暴力 一开始还想先分析哪个点会引出最少的分支数量,然后优化顺序。 但是转念一想,既然都写暴力了,就别考虑这么复杂的问题了() 因为题目给的是九宫格类型的拓展,所以最开始写的暴搜是从左上角开始,每次扩展九宫格的搜索方式,搜索完毕之后再进行check 但是这样只有15分 稍作思考一下,便能发现是这个完全 阅读全文
摘要:
因式分解之后发现,满足条件的x要么是奇数,要么是4的倍数 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #define R(x) x = read() #d 阅读全文
摘要:
暴力 直接暴力枚举区间,并且逐个判断 #include <iostream> #include <stdio.h> #include <algorithm> #include <string.h> #include <string> #include <cmath> #define R(x) x = 阅读全文
摘要:
问题转化 很容易就能把原问题转化成: 求满足 Max-Min = r-l的区间个数 暴力解法 根据上面得到的性质,我们可以暴力枚举区间,来判断当前区间是否满足性质 #include <iostream> #include <stdio.h> #include <algorithm> #include 阅读全文
摘要:
这道题是 P8600 [蓝桥杯 2013 省 B] 连号区间数 的前置知识 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #define R(x) x = 阅读全文
摘要:
#include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #include <string.h> #define R(x) x = read() #define For 阅读全文
摘要:
#include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #include <string.h> #define R(x) x = read() #define For 阅读全文
摘要:
思路 状压+优化 代码 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #include <string.h> #define R(x) x = read() 阅读全文
摘要:
啊米诺斯1 啊米诺斯 啊米诺斯2 啊米诺斯 阅读全文
摘要:
1.首先想到的做法 设up_len[i]为以a[i]为结尾的最长不下降子序列的长度,down_len[i]表示以a[i]为开始的最长不下降子序列的长度。 在求pre的过程中记录下额外信息:down_pre[i]表示在求down_len[i]的过程中,i是由哪个点转移过来的; 得到dp的转移方程: i 阅读全文