Problem Description Pony is the boss of a courier company. The company needs to deliver packages to n offices numbered from 1 to n. Especially, the s-th office is the transfer station of the courier company. There are x ordinary two-way roads and y o…
题中有一个坑点,就是模式串可以相同,并且全部计数. #include <bits/stdc++.h> using namespace std; const int maxn=1e6+10; const int N=maxn; char str[maxn]; struct Dfa { int trie[N][26],cnt; int e[N]; int fail[N]; char ch; void init(char c) { memset(trie,0,sizeof(trie)); memse…
POJ_3013_最短路 Big Christmas Tree Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 23630 Accepted: 5125 Description Christmas is coming to KCM city. Suby the loyal civilian in KCM city is preparing a big neat Christmas tree. The simple s…