问
  • 板块灌水区
  • 楼主YONEX
  • 当前回复3
  • 已保存回复3
  • 发布时间2024/8/25 11:19
  • 上次更新2024/8/25 14:17:31
查看原帖
问
737219
YONEX楼主2024/8/25 11:19

离奇RE ,玄关,拜谢

P5587

CODE

#include<bits/stdc++.h>
using namespace std;
string s[100005];string a;
string sta;
int topa=-1,tops[100005];
int ans=0;
int main(){
	
	int itop=1;
	while(getline(cin,a)&&a!="EOF"){
		tops[itop]=-1;
		for(int j=0;j<a.length();j++){
			if(a[j]=='<'&&tops[itop]>=0)tops[itop]--;
			else s[itop][++tops[itop]]=a[j];
		}
	
		itop++;
	}
	int i=1;
	while(getline(cin,a)&&a!="EOF"){
		
		
		
		topa=-1;
		
		for(int j=0;j<=a.length();j++)
		{
			if(a[j]=='<'&&topa>=0)topa--;
			else sta[++topa]=a[j];
		}
		
		
		
		if(i<=itop){
		//	cout<<tops[i]<<endl;
			for(int j=0;j<=tops[i];j++)
	    	{
	    		//cout<<s[i][j]<<' '<<sta[j]<<endl;
			if(s[i][j]==sta[j])ans++;
		    }
		}
		
	
	
		i++; 
	}
	
	int t;cin>>t;
	printf("%d",ans*60/t);
	return 0;
}
2024/8/25 11:19
加载中...