-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbus to udayland.cpp
More file actions
91 lines (85 loc) · 2.01 KB
/
bus to udayland.cpp
File metadata and controls
91 lines (85 loc) · 2.01 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
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
80
81
82
83
84
85
86
87
88
89
90
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int N = 1000;
char bus[N][5];
void printbus(int n)
{
for(int i = 0; i < n; i++)
{
for(int j = 0; j < 5; j++)
{
cout << bus[i][j];
}
cout << '\n';
}
}
void yes()
{
cout << "YES" << '\n';
}
void no()
{
cout << "NO" << '\n';
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(0); cin.tie(0);
int n; cin >> n;
for(int i = 0; i < n; i++)
{
for(int j = 0; j < 5; j++)
{
cin >> bus[i][j];
}
}
bool possible = false;
for(int i = 0; i < n; i++)
{
for(int j = 0; j < 2; j++)
{
if(bus[i][j*3] == 'O' && bus[i][j*3+1] == 'O')
{
bus[i][j*3] = '+';
bus[i][j*3+1] = '+';
possible = true;
break;
}
}
if(possible) break;
}
if(!possible)
{
no();
return 0;
}
else
{
yes();
printbus(n);
return 0;
}
return 0;