All in All
UVA - 10340
题目传送门
将两个字符串对比一下即可。
AC代码:
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>
#include <set>
#include <utility>
#include <sstream>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define inf 0x3f3f3f3f
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define lep(i,l,r) for(int i=l;i>=r;i--)
#define ms(arr) memset(arr,0,sizeof(arr))
//priority_queue<int,vector<int> ,greater<int> >q;
const int maxn = (int)1e5 + 5;
const ll mod = 1e9+7;
char s[maxn];
char t[maxn];
int main()
{#ifndef ONLINE_JUDGEfreopen("in.txt", "r", stdin);#endif//freopen("out.txt", "w", stdout);ios::sync_with_stdio(0),cin.tie(0);while(scanf("%s %s",s,t)!=EOF){int i=0,j=0;int slen=strlen(s);int tlen=strlen(t);while(i<slen&&j<tlen){if(s[i]==t[j]){i++;j++;}elsej++;}if(i==slen)printf("Yes\n");elseprintf("No\n");}return 0;
}