# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
473037 | rainboy | Planinarenje (COCI18_planinarenje) | C11 | 7 ms | 1096 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 <stdio.h>
#define N 10
int dp[1 << N + N][N + N], n; char adj[N + N][N + N], visited[1 << N + N][N + N];
int dfs(int b, int i) {
if (!visited[b][i]) {
int j;
visited[b][i] = 1;
for (j = 0; j < n + n; j++)
if (adj[i][j] && (b & 1 << j) == 0 && !dfs(b | 1 << j, j)) {
dp[b][i] = 1;
break;
}
}
return dp[b][i];
}
int main() {
int m, i, j;
scanf("%d%d", &n, &m);
while (m--) {
scanf("%d%d", &i, &j), i--, j--;
adj[i][n + j] = adj[n + j][i] = 1;
}
for (i = 0; i < n; i++)
printf(dfs(1 << i, i) ? "Slavko\n" : "Mirko\n");
return 0;
}
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... |
# | 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... |