UVA 10340 All in All
2013-01-18 18:14
239 查看
大意不再赘述。
思路:对s,t扫描一遍即可。注意字符串的大小大概是10万左右。
思路:对s,t扫描一遍即可。注意字符串的大小大概是10万左右。
#include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> #include <string> #include <algorithm> using namespace std; const int MAXN = 101000; char s1[MAXN], s2[MAXN]; int Cmp(char *s1, char *s2) { int i, j; int len1 = strlen(s1), len2 = strlen(s2); for(i = 0, j = 0; i < len1 && j < len2;) { if(s1[i] == s2[j]) i++, j++; else j++; } return len1 == i; } int main() { while(~scanf("%s%s", s1, s2)) { printf(Cmp(s1, s2)? "Yes\n":"No\n"); } return 0; }
相关文章推荐
- UVA 10340 - All in All 水~
- UVa 10340 - All in All
- uva 10340 All in All
- 【习题 3-9 UVA - 10340】All in All
- UVA-10340 All in All
- All in All, UVa 10340
- UVA 10340 All in All
- UVa 10340:All in All(字符串)
- UVa 10340 - All in All
- UVA 10340 All in All
- UVa 10340 All in All (水题,匹配)
- uva 10340 All in All(子串)
- 子序列-All in All,UVa10340
- uva10340 - All in All
- Uva - 10340 - All in All(指针扫描)
- Problem 018 ——UVa 10340 - All in All
- (入门) uva 10340 All in all
- UVa-10340 - All in All
- 习题3-9 UVa10340 All in All
- uva10340 -All in All