/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 2ms 332.0 KiB
#2 Accepted 2ms 332.0 KiB
#3 Wrong Answer 2ms 516.0 KiB

Code

#include<bits/stdc++.h>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define ll long long int
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define mx_ele(v) *max_element(v.begin(),v.end())
#define mnm_ele(v) *min_element(v.begin(),v.end())
#define endl "\n"
using namespace std;
void smile()
{
    string s;
    cin>>s;
    string s1;
    cin>>s1;
    vector<int>pos;
    int start=0;
    for(auto x:s1)
    {
        int flag=0;
        for(int j=0;j<s.size();j++)
        {
            if(x==s[j])
            {
                int temp=j+1;
               // j=temp;
                pos.pb(temp);
                flag=1;
                break;
            }
        }
        if(flag==0)
            break;
    }
    if(is_sorted(all(pos)) and pos.size()==s1.size())
    yes;
    else
    no;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int T=1;
    cin>>T;
    while(T--)
    {
        smile();
    }

}
    

Information

Submit By
Type
Submission
Problem
P1020 Favourite footballer
Contest
Brain booster - 1
Language
C++17 (G++ 13.2.0)
Submit At
2023-12-31 15:01:46
Judged At
2024-11-11 03:46:03
Judged By
Score
10
Total Time
2ms
Peak Memory
516.0 KiB