题目链接 import java.util.Scanner; public class Main { long mod = (long) (1e9 + 7); int MAXN = 107; int a[] = new int[MAXN]; int MA = (int) (1e5 + 7); int MA2 = MA << 1; int dp[] = new int[MA2]; int nexDp[] = new int[MA2]; int N, S; Main() { Scanner cin…
http://hihocoder.com/contest/hiho133/problem/1 2-sat模板...详细的题解请看题目里的提示. tarjan模板打错again致命伤qwq #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N = 103; const int M = 1003; bool inst[N << 1]; str…
http://hihocoder.com/problemset/problem/1467 2-sat模板...详细的题解请看题目里的提示. tarjan模板打错again致命伤qwq #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N = 103; const int M = 1003; bool inst[N << 1]; struc…
Hrdv is interested in a string,especially the palindrome string.So he wants some palindrome string.A sequence of characters is a palindrome if it is the same written forwards and backwards. For example, 'abeba' is a palindrome, but 'abcd' is not.A pa…
Description A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the minimal number of characters to be inserted into t…
Description In a few months the European Currency Union will become a reality. However, to join the club, the Maastricht criteria must be fulfilled, and this is not a trivial task for the countries (maybe except for Luxembourg). To enforce that Germa…
Description Let x and y be two strings over some finite alphabet A. We would like to transform x into y allowing only operations given below: Deletion: a letter in x is missing in y at a corresponding position. Insertion: a letter in y is missing in …