Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
果然大水啊#include <stdio.h> #include <string.h> #include <iostream> #include <cstdlib> #include <string> #include <vector> #include <map> #include <cmath> using namespace std; char s[100005], t[100005]; bool solve(char *s, char *t){ int sl = strlen(s), tl = strlen(t); if(sl > tl) return 0; int sf = 0, tf = 0; while(sf < sl && sl-sf <= tl-tf){ if(s[sf]==t[tf]) sf++; tf++; } if(sf == sl) return 1; return 0; } int main(int argc, char **argv){ while(scanf("%s%s", s, t) == 2){ printf(solve(s,t)? "Yes\n": "No\n"); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator