求调LAO(70pts)
  • 板块P2264 情书
  • 楼主704zhaopeiyu
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/10/24 20:20
  • 上次更新2024/10/24 21:08:34
查看原帖
求调LAO(70pts)
1228492
704zhaopeiyu楼主2024/10/24 20:20
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll n,p,ans,cnt=1;
ll vis[10001];
string word1[1001],word2[1001],a;
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>word1[i];
		for(int j=0;j<word1[i].size();j++)
		{
		if(word1[i][j]>='A'&&word1[i][j]<='Z') word1[i][j]+=32;
		}//xiao
	} 
	getline(cin,a);
	getline(cin,a);
	for(int i=0;i<a.size();i++)
	{
		if(a[i]>='A'&&a[i]<='Z') a[i]+=32;
	}//xiao
	for(int i=0;i<a.size();i++)
	{
		if(a[i]!='.'){
			word2[cnt]+=a[i];
		}
		else cnt++;
	}//fen
	//for(int i=1;i<=cnt;i++) cout<<word2[i]<<endl;
	for(int i=1;i<=cnt;i++){
		for(int j=1;j<=n;j++)
		{
			if(word2[i].find(word1[j])!=string::npos){
				ans++;
			}
		}
	}//ji
	
	cout<<ans;
	return 0;
} 
input:
1

YOU

At there waiting for you. Be with you. Call you just to say hi. Dont mind you shout at me. Envision the whole of you. Forever stand by you. Give you what you need. Have you enjoy your life. I love you. Just want to stay with you. Keep you close at heart. Learn to know you. Make a difference in your life. Never make you cry. Offer support. Put you in my heart. Quiet your fear. Run with you. Sing a song for you. Taciturn knight. Understand you. Value you. Work beside you. XL love. You are all the time so addictive. Zeal for you. 

print:
21

要写作业了条不了了

2024/10/24 20:20
加载中...