B. War of the Corporations 题目连接: http://www.codeforces.com/contest/625/problem/B Description A long time ago, in a galaxy far far away two giant IT-corporations Pineapple and Gogol continue their fierce competition. Crucial moment is just around the…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A long time ago, in a galaxy far far away two giant IT-corporations Pineapple and Gogol continue their fierce competition. Crucial moment is…
A long time ago, in a galaxy far far away two giant IT-corporations Pineapple and Gogol continue their fierce competition. Crucial moment is just around the corner: Gogol is ready to release it's new tablet Lastus 3000. This new device is equipped wi…
传送门 Description A long time ago, in a galaxy far far away two giant IT-corporations Pineapple and Gogol continue their fierce competition. Crucial moment is just around the corner: Gogol is ready to release it's new tablet Lastus 3000. This new devic…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output A long time ago, in a galaxy far far away two giant IT-corporations Pineapple and Gogol continue their fierce competition. Crucial moment is just…
求最小不重复匹配次数 改最后一个字符最划算 我当时怎么就没看出来.. #include<bits/stdc++.h> using namespace std; string S,T; int main(){ while(cin>>S>>T){ int ans=0; for(int i = 0; i < S.length();){ if(T==S.substr(i,T.length())){ ans++; S[i+T.length()-1]='#'; i=i+T.l…
题意就是一个串在另一个串出现几次,但是字符不能重复匹配, 比如aaaaaaa aaaa的答案是1 思路: 本来写了个暴力过的,然后觉得KMP改改就好了,就让队友打了一个: #include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAX=1000010; int n,m; char a[MAX],b[MAX]; int nextval[MAX]; LL ans; void get_next(ch…