-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolour.cpp
More file actions
54 lines (53 loc) · 1.12 KB
/
colour.cpp
File metadata and controls
54 lines (53 loc) · 1.12 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <bits/stdc++.h>
#define ln long long
using namespace std;
int main()
{
// your code goes here
ln num, col, l, c;
cin >> num;
while (num--)
{
col = 0;
vector<ln> vrr(3);
for (ln l = 0; l < 3; l++)
cin >> vrr[l];
for (ln l = 0; l < 3; l++)
{
if (vrr[l] != 0)
{
vrr[l]--;
col++;
}
}
for (ln l = 0; l < 3; l++)
{
for (ln c = l + 1; c < 3; c++)
{
if (vrr[l] > vrr[c])
swap(vrr[l], vrr[c]);
}
}
if (vrr[0] >= 2)
cout << col + 3 << "\n";
else if (vrr[0] == 1)
{
if (vrr[2] >= 2)
cout << col + 2
<< "\n";
else
cout << col + 1
<< "\n";
}
else
{
if (vrr[1] == 0)
cout << col
<< "\n";
else
cout << col + 1
<< "\n";
}
}
return 0;
}