답안 #659776

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
659776 2022-11-19T09:14:24 Z Nanu Ronald (COCI17_ronald) C++14
0 / 120
121 ms 5476 KB
#include <iostream>
#include <vector>

using namespace std;

///ifstream cin("info.in");
///ofstream cout("info.out");

#define DIM 1000

bool sel[DIM + 1];
int n, m;
vector <int> G[DIM + 1];

static inline void dfs(int nod) {
    sel[nod] = 1;
    for(auto e : G[nod])
        if(!sel[e])
            dfs(e);
}

int main()
{
    cin >> n >> m;
    for(int i = 1, x, y; i <= m; i++) {
        cin >> x >> y;
        G[x].push_back(y);
        G[y].push_back(x);
    }

    dfs(1);

    int nrcomp = 1;
    for(int i = 1; i <= n; i++)
        if(!sel[i]) {
            sel[i] = 1;
            dfs(i);
        }

    if(nrcomp % 2 == 1)
        cout << "NE";
    else cout << "DA";

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 324 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 320 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Incorrect 1 ms 324 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 468 KB Output is correct
2 Correct 25 ms 1244 KB Output is correct
3 Correct 94 ms 3920 KB Output is correct
4 Incorrect 121 ms 5476 KB Output isn't correct
5 Halted 0 ms 0 KB -