Accepted
Code
#include<bits/stdc++.h>
using namespace std;
void solve()
{
string s,n; cin>>s>>n;
int a=s.size(), b=n.size();
int ind=0;
bool ok=false;
for(int i=0;i<a;i++)
{
if(s[i]==n[ind])
{
++ind;
}
if(ind==b) {ok=true; break;}
}
if(ok){cout<<"YES"<<endl; return;}
else cout<<"NO"<<endl;
}
int main(){int t; cin>>t; while(t--) solve();}
Information
- Submit By
- Type
- Submission
- Problem
- P1020 Favourite footballer
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2023-12-24 07:44:56
- Judged At
- 2024-11-11 03:47:14
- Judged By
- Score
- 100
- Total Time
- 2ms
- Peak Memory
- 536.0 KiB