提交时间:2022-10-15 11:28:28
运行 ID: 60365
#include <bits/stdc++.h> using namespace std; string s1 , s2; void F() { for( int i = 0 ; i < s1.size() ; i++ ) if( s1[ i ] != s2[ i % s2.size() ] ) { puts( "NO" ); return; } puts( "YES" ); } signed main() { int t; scanf( "%d" , &t ); while( t-- ) { cin >> s1 >> s2; F(); } return 0; }