# HIIT Open 2016

 Start: 2016-05-28 11:00:00 End: 2016-05-28 16:00:00

CSES - HIIT Open 2016 - Results
History
2016-05-28 12:59:41
 Task: Graph painting Sender: Noname 01 Submission time: 2016-05-28 12:59:41 Language: C++ Status: READY Result: ACCEPTED

## Test results

 test verdict time (s) #1 ACCEPTED 0.04 / 1.00 details #2 ACCEPTED 0.05 / 1.00 details #3 ACCEPTED 0.11 / 1.00 details

## Code

```// NONAME-01

#include <bits/stdc++.h>

using namespace std;

int n, m;
vector< vector<int> > nxt;
vector <int> col;

{
cin >> n >> m;
nxt.resize(n);
int i;
for (i = 0; i < n; i++) nxt.resize(0);
for (i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
a--;
b--;
nxt[a].push_back(b);
nxt[b].push_back(a);
}
}

void Solve()
{
int i, j;
col.resize(n);
col[0] = 0;
int a, b;
for (i = 1; i < n; i++) {
a = 0;
b = 0;
for (j = 0; j < (int)nxt[i].size();j++) {
int k = nxt[i][j];
if (k > i) continue;
if (col[k] == 0) a++;
else b++;
}
if (a > b) {
col[i] = 1;
} else {
col[i] = 0;
}
}
for (i = 0; i < n; i++) {
if ( col[i] == 0) cout << "R ";
else cout << "B ";
}
cout << "\n";
}

int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int nt, tt;
cin >> nt;
for (tt = 0; tt < nt; tt++) {
Solve();
}
return 0;
}```

## Test details

### Test 1

Verdict: ACCEPTED

input
```100 7 1 2 5 8 28 2 7 6 7 4 6 2 3 3 5 7 8 4 8 5 7 5 6 4 7 6 8 1 4 2 6 4 5 3 8 2 8 ...```
view   save

correct output
```B R B B B B R R B B R B R B B R R B B B B R R R B B B R B R B B B B R B R R B R B R B B B B R B R B R B B B R B R B R B R R B R B R R R R R B B R B R R R R B R R R R B B R R R B B B R B R R R R B R B B B R B R B B R R B R B B B R R ...```
view   save

user output
```R R R R B R R R B R B R B R B R B R B R R R R B R R B R B R B R B B R R R B B R R R B R R B B R B R B R R R B R B R B R B R B R R B R B R B R B R R R B B R R R B R B R R R R B B R B R R B B R R R B R B B R B R R B R B B R R R R B R ...```
view   save

### Test 2

Verdict: ACCEPTED

input
```10 38 36 18 28 20 37 22 38 17 33 17 30 26 34 12 37 1 18 36 37 33 34 24 34 18 22 3 11 3 28 29 33 16 35 25 38 10 23 ...```
view   save

correct output
```R R B R B R R R R R B B R B R ... R R B B B R R B R B R B R B R ... B B R R R R B R B B B R R B R ... R R B R B B R B B R R R B B B B R B B B R R ... R R B B R R R B R R B R R R B ... B R R B R B B B R R R R B B R R B B B R R B R B B B B B ... R R B R R R R R B R B B R R R ... R R B R B B R R B R B B B R B ...```
view   save

user output
```R R R R R R R R R R B R R R R ... R R R R R B R R R R R R R B R ... R R R R R R R R R R R R R R R ... R B R R B B R R R R R R R R R R R R R R B R ... R B R R R R R R R R R B R B B ... R R R R R B B R R B R R B R R R R R R R R R R R R R R R ... R R R R R R R R R R R R R R R ... R R R R R R R B R R R R B R B ...```
view   save

### Test 3

Verdict: ACCEPTED

input
```1 100000 200000 89300 98492 33853 56822 92967 99427 42461 62590 20195 38987 80870 85808 20624 64006 62088 88344 8872 92190 42562 66966 12882 52315 1520 96552 45353 90886 94940 99227 53663 62317 43160 66687 93275 93293 97160 97656 ...```
view   save

correct output
`R R R R B R R R B B B R B B B ...`
view   save

user output
`R R R R R R R R R R R R R R R ...`
view   save