/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB

Code

#include <iostream>

using namespace std;

int main()
{
    int t;
	cin >> t;
	string a, b;
	while (t-- && cin >> a >> b)
	{
		int j = 0;
		for (int i = 0; i < a.size() && j < b.size(); i++)
		{
			if (a[i] == b[j])
			{
				j++;
			}
		}
		if (j == b.size())
		{
			cout << "YES\n";
		}
		else {
			cout << "NO\n";
		}
	}
}

Information

Submit By
Type
Pretest
Problem
P1020 Favourite footballer
Language
C++17 (G++ 13.2.0)
Submit At
2023-12-29 15:06:09
Judged At
2023-12-29 15:06:28
Judged By
Score
10
Total Time
1ms
Peak Memory
540.0 KiB