QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#595372 | #3673. Generalized German Quotation | MAX_IN | WA | 0ms | 3560kb | C++14 | 571b | 2024-09-28 13:34:21 | 2024-09-28 13:34:22 |
Judging History
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 `<'