hiho week 33 register

Ended

Participants:140

Verdict:Accepted
Score:100 / 100
Submitted:2015-02-17 10:10:30

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
using namespace std;
int conn[10005][10005];
int connn[10005];
int group[10005];
bool correct = true;
void setcolor(int i, int color){
    if (group[i] != 0 && group[i] != color)
        correct = false;
    if (!correct || group[i])
        return;
    group[i] = color;
    for (int j = 1; j <= connn[i]; j++)
        setcolor(conn[i][j], -color);
}
int main()
{
    int cc, tt;
    int n, m;
    cin >> tt;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX