QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#190511 | #3673. Generalized German Quotation | maghrabyJr_# | WA | 0ms | 3440kb | C++20 | 857b | 2023-09-29 00:50:46 | 2023-09-29 00:50:47 |
Judging History
answer
#include "bits/stdc++.h"
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
int32_t main(){
cin.tie(0);
cin.sync_with_stdio(0);
string s; cin>>s;
int n= s.length();
stack<int> stk;
char ans[n];
for(int i = 0; i < n; i++){
if(!stk.empty() && s[stk.top()] != s[i]){
ans[stk.top()]= '[';
ans[i]= ']';
stk.pop();
}else{
stk.push(i);
}
}
if(stk.size()){
cout<<"Keine Loesung\n";
}else{
for(char c : ans)
cout<<c;
cout<<"\n";
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3440kb
input:
<<>><<<<>>>>
output:
[[]][[[[]]]]
result:
wrong answer Wrong solution length: 12 instead of 6