40分,求助
查看原帖
40分,求助
1069816
Tsuki091117楼主2023/8/22 10:42
#include<bits/stdc++.h>
using namespace std;
string s1[1000010],s2[1000010];
int len_s1,len_s2,T,ans,i,j;
int main(){
	ios::sync_with_stdio(false);
	while(getline(cin,s1[len_s1])){
		if(s1[len_s1]=="EOF"){
			break;
		}
		for(int j=0;j<s1[len_s1].size();j++){
			if(s1[len_s1][j]=='<'&&!s1[len_s1].empty()){
				s1[len_s1].erase(len_s1-1,2);
			}
		}
		len_s1++;
	}
	while(getline(cin,s2[len_s2])){
		if(s2[len_s2]=="EOF"){
			break;
		}
		for(int j=0;j<s2[len_s2].size();j++){
			if(s2[len_s2][j]=='<'&&!s2[len_s2].empty()){
				s2[len_s2].erase(len_s2-1,2);
			}
			if(s1[len_s2][j]==s2[len_s2][j]){
				ans++;
			}
		}
		len_s2++;
	}
	cin>>T;
	cout<<round(ans*1.0/T*60);
	return 0;
}
2023/8/22 10:42
加载中...