摘要:
q次询问,每次求出边长大于k构成图中能两两互达的点的对数。 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define LL long long cons 阅读全文
摘要:
传送门 题目大意:给出一个点(x,y),给出移动的顺序包含LRUD的一个字符串s,问是否存在s的一个排列,能在方格移动时不经过(x,y)。其实只要猜到 U D L R,相同字母都挨着,然后全排列枚举。 (出了个BUG,没理解next_permutation. #include<iostream> # 阅读全文
摘要:
A. Mean Inequality 题目大意:长度2n的序列,求这个序列的一个排列,要求a[i]!=(a[i-1]+a[i+1])/2 题解:将序列排序,每次分别从序列最左侧和最右侧取数组成新的序列。 #include<iostream> #include<cstdio> #include<cst 阅读全文