2147. 字符环

Andrew-Malcom

include

using namespace std;
int main()
{
        int t;cin>>t;
        cin.get();
        while(t--){
                int a,b;cin>>a>>b;
                string s1,s2;
                cin>>s1>>s2;
                s1=s1+s1;
                if(s1.find(s2)!=s1.npos&&a>=b){
                        cout<<"YES"<<endl;
                }
                else cout<<"NO"<<endl;
        }
}
你当前正在回复 博客/题目
存在问题!