摘要:
原题链接 题解 先求出以所有最长回文子串,然后记录以每个点作为回文串的右端点时的最小左端点和作为回文串的左端点时的最大右端点 code #include<bits/stdc++.h> #define ll long long using namespace std; int r[200005],l[ 阅读全文
摘要:
原题链接 题解 手写栈存放已经匹配过的位置和每个位置匹配的进度,每次匹配成功就回溯,相当于删除子串 code #include<bits/stdc++.h> #define ll long long using namespace std; int con[1000006],pre[1000006] 阅读全文
摘要:
原题链接 题解 经典的状压dp code #include<bits/stdc++.h> #define ll long long #define lowbit(x) ((x)&(-x)) using namespace std; int sit[105]; int dp[505][505][4]; 阅读全文
摘要:
原题链接 题解 由于 \(a\oplus b \leq a+b\) ,所以全部异或起来 code #include<bits/stdc++.h> #define ll long long using namespace std; void solve() { int n; cin>>n; int a 阅读全文