摘要:
"传送门easy" "传送门hard" ~~切水题的感觉真好~~ 看到数据范围这么小,所以暴力枚举所有的可能,然后用map+vector存下每种值的区间,然后贪心去选 代码: c++ include include include include include include using name 阅读全文
摘要:
"传送门" 这居然是个 1800的题,有点无法接受,可能自己$dp$方面确实差了点 考虑按位$dp$,从高位到低位枚举,然后用$dp$去判断是否可行。 然后设$f[i][j]$表示前$i$个分成$j$块能否满足当前枚举的答案 代码: c++ include include include inclu 阅读全文
摘要:
"传送门" 主席树裸题,考虑出现一半次数以上的数一定是这个区间的中位数,查询中位数再判断一下中位数出现的次数就好了 注意要离散化 代码: c++ include include include include using namespace std; void read(int &x) { char 阅读全文
摘要:
"传送门" 二元组建图 一共有四种二元关系,对于同选文和同选理的情况需要新开两个点来计算 代码: c++ include include include include include using namespace std; void read(int &x) { char ch; bool ok 阅读全文