# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
473037 | 2021-09-14T19:00:45 Z | rainboy | Planinarenje (COCI18_planinarenje) | C | 7 ms | 1096 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 332 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 460 KB | Output is correct |
2 | Correct | 1 ms | 588 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 1096 KB | Output is correct |
2 | Correct | 1 ms | 332 KB | Output is correct |
3 | Correct | 0 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 5 ms | 400 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 7 ms | 844 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 6 ms | 428 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 6 ms | 332 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 7 ms | 588 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 7 ms | 612 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 7 ms | 644 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |