# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
75099 | Yehezkiel | Match (CEOI16_match) | C++11 | 2044 ms | 944 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int MAXN=2000;
int n;
string input;
bool coba(int idx,stack<char> characters){
for(int i = idx; i < n ; i++) {
if(!characters.empty() && characters.top() == input[i]) {
characters.pop();
} else {
characters.push(input[i]);
}
}
return characters.empty();
}
bool possible(){
stack <char> temp;
return coba(0,temp);
}
string makeAns(){
string ret="";
stack <char> characters;
for(int i = 0; i < n; i++) {
characters.push(input[i]);
if(characters.empty()||characters.top() != input[i]) {
ret += "(";
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |