#include <iostream>
#include <vector>
using namespace std;
///ifstream cin("info.in");
///ofstream cout("info.out");
#define DIM 1000
int n, m;
bool g[DIM + 5][DIM + 5];
static inline void Modif(int c) {
for(int j = 1; j <= n; j++) {
if(g[j][c] == 1)
g[j][c] = 0;
else g[j][c] = 1;
if(g[c][j] == 1)
g[c][j] = 0;
else g[c][j] = 1;
}
}
static inline bool Check() {
for(int i = 1; i <= n; i++)
if(!g[i][1])
Modif(i);
for(int i = 1; i <= n; i++)
for(int j = i + 1; j <= n; j++)
if(!g[i][j])
return 0;
return 1;
}
int main() {
cin >> n >> m;
for(int i = 1, x, y; i <= m; i++) {
cin >> x >> y;
g[x][y] = g[y][x] = 1;
}
cout << (Check() == 0 ? "NE" : "DA");
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
468 KB |
Output is correct |
2 |
Correct |
24 ms |
776 KB |
Output is correct |
3 |
Correct |
8 ms |
596 KB |
Output is correct |
4 |
Correct |
5 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
468 KB |
Output is correct |
2 |
Correct |
16 ms |
724 KB |
Output is correct |
3 |
Correct |
65 ms |
1264 KB |
Output is correct |
4 |
Correct |
102 ms |
1268 KB |
Output is correct |