# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
223380 | tqbfjotld | Matching (COCI20_matching) | C++14 | 5 ms | 384 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;
bool done[45];
int u[45],r[45];
int connect[45];
bool toret = false;
int N;
void iterate(int n){
if (n==N){
printf("DA\n");
for (int x = 0; x<n; x++){
if (connect[x]!=-1){
printf("%d %d\n",x+1,connect[x]+1);
}
}
toret = true;
return;
}
if (u[n]!=-1){
if (!done[u[n]]){
connect[n] = u[n];
done[n] = true;
done[u[n]] = true;
int t = n+1;
while (done[t]) t++;
iterate(t);
connect[n] = -1;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |