Add FZOI Codes

This commit is contained in:
2024-06-26 22:14:00 +08:00
parent 8f564ca60e
commit b80791cfad
49 changed files with 1653 additions and 0 deletions

View File

@ -0,0 +1,45 @@
#include<iostream>
using namespace std;
int n, m, tot[1001];
string nx[1001], en[101];
int f(string nn,string ee)
{
int now = -1;
string::size_type po = 0;
for(int i = 0; i < ee.size(); i++)
{
po = nn.find(ee[i], now+1);
if(po == nn.npos)return 0;
now = po;
}
return 1;
}
int main()
{
cin >> n >> m;
for(int i = 1; i <= n; i ++ )
{
cin >> nx[i];
for(int j = 0; j < nx[i].size(); j ++ )
{
if(nx[i][j] > 96) nx[i][j] -= 32;
}
}
for(int i = 1; i <= m; i ++ )
{
cin >> en[i];
for(int j = 0; j < en[i].size(); j ++ )
{
if(en[i][j] > 96) en[i][j] -= 32;
}
for(int j = 1; j <= n; j ++ )
{
if(f(nx[j], en[i])) tot[j] ++ ;
}
}
for(int i = 1; i <= n; i ++ ) cout << tot[i] << endl;
}