Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <stdio.h>#include <algorithm>#include <cstdlib>#include <cstring>#include <bitset>#include <string>#include <stack>#include <cmath>#include <queue>#include <set>#include <map>using namespace std;#define INF 0x3f3f3f3f#define LC(x) (x<<1)#define RC(x) ((x<<1)+1)#define MID(x,y) ((x+y)>>1)#define fin(name) freopen(name,"r",stdin)#define fout(name) freopen(name,"w",stdout)#define CLR(arr,val) memset(arr,val,sizeof(arr))#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);typedef pair<int, int> pii;typedef long long LL;const double PI = acos(-1.0);const int N = 510;int head[N], tot;int pre[N];void init(){CLR(pre, -1);}