/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 536.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Accepted 1ms 532.0 KiB
#4 Accepted 1ms 532.0 KiB
#5 Accepted 2ms 532.0 KiB
#6 Accepted 2ms 488.0 KiB
#7 Accepted 1ms 536.0 KiB

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