-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1335D.cpp
More file actions
48 lines (47 loc) · 888 Bytes
/
1335D.cpp
File metadata and controls
48 lines (47 loc) · 888 Bytes
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
#include <bits/stdc++.h>
#define mod 1000000007
#define FOR(i, a, b) for (i = a; i < b; i++)
using namespace std;
typedef long long ll;
void printV(vector<ll> v)
{
for (int i = 0; i < v.size(); i++)
cout << v[i] << " ";
}
int modexp(ll A, ll B, ll C)
{
if (A == 0)
return 0;
if (B == 0)
return 1;
ll y;
if (B % 2 == 0)
{
y = modexp(A, B / 2, C);
y = (y * y) % C;
}
else
{
y = A % C;
y = (y * modexp(A, B - 1, C) % C) % C;
}
return (ll)((y + C) % C);
}
int main()
{
ll t;
cin >> t;
while (t--)
{
string board[9];
for (int i = 0; i < 9; i++)
{
cin >> board[i];
replace(board[i].begin(), board[i].end(), '2', '1');
}
for (int i = 0; i < 9; i++)
{
cout << board[i] << endl;
}
}
}