답안 #659815

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
659815 2022-11-19T10:05:28 Z Nanu Ronald (COCI17_ronald) C++14
120 / 120
93 ms 1236 KB
#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 l) {
    for(int j = 1; j <= n; j++) {
        if(g[l][j] == 1)
            g[l][j] = 0;
        else g[l][j] = 1;

        if(g[j][l] == 1)
            g[j][l] = 0;
        else g[j][l] = 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 1 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 1 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 1 ms 212 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 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 26 ms 724 KB Output is correct
3 Correct 14 ms 600 KB Output is correct
4 Correct 7 ms 596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 468 KB Output is correct
2 Correct 20 ms 724 KB Output is correct
3 Correct 59 ms 1236 KB Output is correct
4 Correct 93 ms 1236 KB Output is correct