QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#595372#3673. Generalized German QuotationMAX_INWA 0ms3560kbC++14571b2024-09-28 13:34:212024-09-28 13:34:22

Judging History

你现在查看的是最新测评结果

  • [2024-09-28 13:34:22]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3560kb
  • [2024-09-28 13:34:21]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int M=2e5+10;

stack<string>s;


signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);

	string h;string ans="";
	cin>>h;
	for(int i=0;i<h.size();i+=2)
	{
		string j="";
		j+=h[i];
		j+=h[i+1];
		if(s.empty())
			s.push(j);
		else{
			if(s.top()==j)
				s.push(j);
			else{
				s.pop();
				ans+='[';
				ans+=']';
			}
		}		
		
		
		
	}
	if(s.size())
	{
		cout<<"Keine Loesung\n";
	}
	else{
		cout<<ans<<"\n";
	}







	return 0;

}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3560kb

input:

<<>><<<<>>>>

output:

[][][]

result:

wrong answer `]' closes quote of the same type `<'