-
Notifications
You must be signed in to change notification settings - Fork 4
/
DZY loves chessboard.cpp
66 lines (60 loc) · 1.13 KB
/
DZY loves chessboard.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
#include<bits/stdc++.h>
using namespace std ;
#define F first
#define S second
#define R return
#define C continue
#define pb push_back
#define pf push_front
#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 n , m ;
cin >> n >> m ;
vs v (n) ;
Fi(i , 0 , n-1)
cin >> v[i] ;
Fi(i , 0 , n-1)
{
Fi(j , 0 , m-1)
{
int check = i+j ;
if (v[i][j] == '.')
{
if (check % 2 == 0)
v[i][j] = 'W' ;
else
v[i][j] = 'B' ;
}
}
}
Fi(i , 0 , n-1)
{
cout << v[i] << '\n' ;
}
}
int main()
{
fast
int t = 1 ;
// cin>>t ;
while (t--)
solve (1) ;
return 0 ;
}