wa求解
查看原帖
wa求解
1122530
elpsconr楼主2024/7/12 18:42

不知道为啥wa了7个点,求wa数据

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PII pair<int,int>
const int N=2e5+6,yyx=1e4;
int n,ans;
void solve()
{
 string s,t;cin>>s>>t;
 int x=s.size();
 for(int i=1;i<x;++i)
 {
    for(int k=1;k<=i;++k)
    {
       string y="";
       for(int j=0;j+k<=x;j+=k)
       {
            string m=s.substr(j,k);
            if(m[k-1]>='a'&&m[k-1]<='z') y+=m[k-1];
       }
       //cout<<y<<endl;
       if(y==t)
       {
        puts("Yes");return;
       }
    }
 }
 puts("No");
}
int main()
{
  int tt=1;
  //cin>>tt;
  while(tt--)
  solve();
  return 0;
}
2024/7/12 18:42
加载中...