UVA 1394 And Then There Was One / Gym 101415A And Then There Was One / UVAlive 3882 And Then There Was One / POJ 3517 And Then There Was One / Aizu 1275 And Then There Was One (动态规划,思维题) Description Let's play a stone removing game. Initially, n ston…
用KMP里面的next数组即可,原理就是next数组的原理 #include<cstdio> #include<cstdlib> #include<algorithm> #include<cstring> #include<vector> #define MAXN 1000000+10 #define ll long long using namespace std; char s[MAXN]; int n; int nxt[MAXN]; voi…