-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12700.cpp
More file actions
42 lines (42 loc) · 1.05 KB
/
12700.cpp
File metadata and controls
42 lines (42 loc) · 1.05 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
#include <bits/stdc++.h>
using namespace std;
int main() {
char a[10000];
int tc, t = 1;
scanf("%d", &tc);
while (tc--) {
int i, j, k, l, m, n;
scanf("%d", &l);
getchar();
gets(a);
sort(a, a + l);
printf("Case %d: ", t++);
k = 0;
n = 0;
int dr = 0;
int ab = 0;
for (i = 0; i < l; i++) {
if (a[i] == 'B')
k++;
else if (a[i] == 'W')
n++;
else if (a[i] == 'T')
dr++;
else if (a[i] == 'A')
ab++;
}
if (ab == l)
puts("ABANDONED");
else if (n > k && k > 0 || n > k && dr > 0)
printf("WWW %d - %d\n", n, k);
else if (k > n && n > 0 || k > n && dr > 0)
printf("BANGLADESH %d - %d\n", k, n);
else if (k + ab == l)
puts("BANGLAWASH");
else if (n + ab == l)
puts("WHITEWASH");
else if (n == k)
printf("DRAW %d %d\n", n, dr);
}
return 0;
}