# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
202053 | 2020-02-13T10:00:37 Z | SamAnd | Ronald (COCI17_ronald) | C++17 | 63 ms | 3320 KB |
#include <bits/stdc++.h> using namespace std; const int N = 1003; int n, m; bool a[N][N]; int c[N]; bool dfs(int x, int u) { c[x] = u; for (int h = 1; h <= n; ++h) { if (h == x) continue; if (!c[h]) { if (a[x][h] == false) { if (!dfs(h, 3 - u)) return false; } else { if (!dfs(h, u)) return false; } } else { if (a[x][h] == false) { if (c[h] != 3 - u) return false; } else { if (c[h] != u) return false; } } } return true; } int main() { scanf("%d%d", &n, &m); for (int i = 0; i < m; ++i) { int x, y; scanf("%d%d", &x, &y); a[x][y] = true; a[y][x] = true; } if (dfs(1, 1)) { printf("DA\n"); return 0; } printf("NE\n"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | Output is correct |
2 | Correct | 6 ms | 376 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Correct | 5 ms | 376 KB | Output is correct |
3 | Correct | 5 ms | 368 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Correct | 5 ms | 376 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Correct | 5 ms | 376 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Correct | 5 ms | 376 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Correct | 6 ms | 376 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 632 KB | Output is correct |
2 | Correct | 19 ms | 1400 KB | Output is correct |
3 | Correct | 10 ms | 760 KB | Output is correct |
4 | Correct | 9 ms | 760 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 504 KB | Output is correct |
2 | Correct | 14 ms | 1144 KB | Output is correct |
3 | Correct | 40 ms | 2552 KB | Output is correct |
4 | Correct | 63 ms | 3320 KB | Output is correct |