汗流浃背了,全RE,救救我吧
查看原帖
汗流浃背了,全RE,救救我吧
661984
Stone_Xz楼主2023/12/27 21:41
#include<bits/stdc++.h>
using namespace std;

int tim,tot;
string tmp,a;
vector<string> ans,s;

int main()
{
	while(getline(cin, tmp)){
		if(tmp == "EOF")
			break;
			
		int pos = 0; // 光标
		for(int i = 0; i < tmp.size(); i++){
			if(tmp[i] == '<' && pos != 0)
				pos--;
			else
				a[++pos] = tmp[i];
		}
		
		string cur;
		for(int i = 0; i < pos; i++)
			cur += a[i];
		ans.push_back(cur);
	}
	
	while(getline(cin, tmp)){
		if(tmp == "EOF")
			break;
			
		int pos = 0; // 光标
		
		for(int i = 0; i < tmp.size(); i++){
			if(tmp[i] == '<' && pos != 0)
				pos--;
			else
				a[++pos] = tmp[i];
		}
		
		string cur;
		for(int i = 0; i < pos; i++)
			cur += a[i];
		s.push_back(cur);
	}
	
	cin >> tim;
	
	for(int i = 0; i < ans.size() && i < s.size(); i++)
		for(int j = 0; j < ans[i].size() && j < s[i].size(); j++)
			if(ans[i][j] == s[i][j])
				tot++;
				
	cout << tot * 60 / tim;
	return 0;
}

找不出问题出在哪 QWQ

2023/12/27 21:41
加载中...