# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
103668 | Anai | Match (CEOI16_match) | C++14 | 18 ms | 11776 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 N = 1e5 + 5, S = 26;
char str[N], ant[N];
int dp[S][N];
int n;
static void solve(int l, int r) {
if (l > r)
return;
int match = dp[str[l] - 'a'][r];
if (!match)
throw -1;
ant[l] = '(';
ant[match] = ')';
solve(l + 1, match - 1);
solve(match + 1, r); }
int main() {
#ifdef HOME
freopen("match.in", "r", stdin);
freopen("match.out", "w", stdout);
#endif
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |