# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
57184 | Bruteforceman | Match (CEOI16_match) | C++11 | 44 ms | 33428 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 s;
bool decide[100010];
int dp[26][100010];
int node[26][100010];
int par[100010];
char letter[100010];
int alpha[26][100010];
char ans[100010];
void solve(int l, int r) {
if(l > r) {
return ;
}
int opt = dp[s[l] - 'a'][r];
if(opt <= l) {
cout << -1 << endl;
exit(0);
}
ans[l] = '(';
ans[opt] = ')';
solve(l + 1, opt - 1);
solve(opt + 1, r);
}
int main(int argc, char const *argv[])
{
ios_base :: sync_with_stdio (false);
cin.tie();
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |