提交时间:2022-07-19 12:09:50
运行 ID: 52426
#include <bits/stdc++.h> using namespace std; int t,a,b,l; string s1,s2; bool f; bool check() { for(int i=0; i<=l; i++) { f=0; for(int j=i; j<=l+i; j++) if(s1[j]!=s2[j-i]) { f++; break; } if(!f) return 1; } return 0; } int main() { cin>>t; while(t--) { cin>>s1>>s2>>a>>b; l=s1.size()-1; s1+=s1; if(check()) cout<<"yes"<<endl; else cout<<"no"<<endl; } }