4 solutions

  • 0
    @ 2023-11-22 20:29:41
    #include<iostream>
    #include<string>
    using namespace std;
    int main(){
      int n,m;
      cin>>n>>m;
      string a[n],b;
      for(int i=0;i<n;i++){
        cin>>a[i];
      }
      cin>>b;
      for(int i=0;i<m;i++){
        b[i]-=2;
      }
      int ans=0;
      for(int i=0;i<n;i++){
        int temp=a[i].find(b);
        while(temp!=-1){
          ans++;
          temp=a[i].find(b,temp+1);
        }
      }
      cout<<ans;
      return 0;
    }
    

    Information

    ID
    129
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    6
    Tags
    # Submissions
    166
    Accepted
    51
    Uploaded By