提交时间:2022-10-15 11:28:36
运行 ID: 60367
#include<iostream> #include<cstdio> using namespace std; int main(){ long long t; string a,b; bool f=true; cin>>t; while(t--){ cin>>a>>b; long long x=a.size(),y=b.size(); if(x%y!=0){ cout<<"NO"<<endl; f=false; } else{ for(int i=0;i<x;i++){ if(a[i]!=b[i%y]){ cout<<"NO"<<endl; f=false; break; } } } if(f)cout<<"YES"<<endl; } }