-
Notifications
You must be signed in to change notification settings - Fork 4
/
A and B and chess.cpp
79 lines (71 loc) · 1.4 KB
/
A and B and chess.cpp
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include<bits/stdc++.h>
using namespace std ;
typedef long long int ll ;
typedef long double ld ;
#define F first
#define S second
#define R return
#define C continue
#define pb push_back
#define pf push_front
#define mp make_pair
#define mod1 1000000007
#define vi vector <int>
#define vl vector <long>
#define vll vector <long long>
#define vii vector <vector <int> >
#define vs vector <string>
#define vpii vector <pair <int , int> >
#define vpll vector <pair <long , long> >
#define Fi(i,L,R) for (int i = L; i <= R; i++)
#define Fd(i,R,L) for (int i = R; i >= L; i--)
#define fast ios_base :: sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
void swap_int(int *a , int *b)
{
int temp = *a ;
*a = *b ;
*b = temp ;
}
int solve (int testcase)
{
int i , j , a = 0 , b = 0 ;
char ch ;
Fi(i , 1 , 8)
{
Fi(j , 1 , 8)
{
cin >> ch ;
if(ch == 'Q')
a += 9 ;
if(ch == 'R')
a += 5 ;
if(ch == 'B' || ch == 'N')
a += 3 ;
if(ch == 'P')
a += 1 ;
if(ch == 'q')
b += 9 ;
if(ch == 'r')
b += 5 ;
if(ch == 'b' || ch == 'n')
b += 3 ;
if(ch == 'p')
b += 1 ;
}
}
if (a > b)
cout << "White" ;
else if (a < b)
cout << "Black" ;
else
cout << "Draw" ;
}
int main()
{
fast
int t = 1 ;
// cin>>t ;
while (t--)
solve (1) ;
return 0 ;
}