# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
659791 | Alexandruabcde | Ronald (COCI17_ronald) | C++14 | 37 ms | 1308 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;
constexpr int NMAX = 1002;
bool V[NMAX];
bool edge[NMAX][NMAX];
int N, M;
void Read () {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> N >> M;
for (int i = 1; i <= N; ++ i )
for (int j = 1; j <= N; ++ j )
edge[i][j] = true;
for (int i = 1; i <= M; ++ i ) {
int x, y;
cin >> x >> y;
edge[x][y] = edge[y][x] = false;
}
}
bool ans = false;
void Solve (int val) {
V[1] = val;
for (int i = 2; i <= N; ++ i )
V[i] = (edge[1][i]^val);
bool ok = true;
for (int i = 1; i <= N; ++ i )
for (int j = i+1; j <= N; ++ j )
if (V[i]^V[j] != edge[i][j]) ok = false;
ans |= ok;
}
int main () {
Read();
for (int i = 0; i < 2; ++ i )
Solve(i);
cout << (ans ? "DA" : "NE") << '\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... |