题解 | 月月查华华的手机

月月查华华的手机

https://www.nowcoder.com/practice/c2877187b1bb4573927e759a60f5d3e1

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
void solve()
{
    string s;
    cin >> s;
    int n;
    cin >> n;
    while (n--)
    {
        string str;
        cin >> str;
        int cur = 0;
        bool mark = 0;
        for (int i = 0; i < str.size(); i++)
        {
            int t=s.find(str[i],cur);
            if (t == -1)
            {
                mark = 1;
                break;
            }
            cur=t+1;
        }
        if (mark)
        {
            cout << "No" << endl;
        }
        else
        {
            cout << "Yes" << endl;
        }
    }
}

signed main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int T = 1;
    // cin >> T;
    while (T--)
    {
        solve();
    }
    return 0;
}

全部评论

相关推荐

02-25 14:28
烟台大学 Java
程序员小白条:大众化,没区分度,另外就是简历的排版,中英文格式,以及表达问题,简历不能过于白话文.....投的太少了,多投吧,现在才2月底,3,4月会多起来的,具体可以看我以前的帖子有一些修改指南之类的
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务