# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
476685 | TlenekWodoru | Match (CEOI16_match) | C++14 | 2090 ms | 332 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;
string odp;
vector<int>U;
string U2;
string A;
void F(int v)
{
if(v==A.size())
{
if(U.size()==0&&(odp.size()==0||odp>U2))
{
odp=U2;
}
return;
}
if(U.size()>0&&A[U[U.size()-1]]==A[v])
{
int kopia=U[U.size()-1];
U2.push_back(')');
U.pop_back();
F(v+1);
U.push_back(kopia);
U2.pop_back();
}
U.push_back(v);
U2.push_back('(');
F(v+1);
U2.pop_back();
U.pop_back();
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |