-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBusToUdayland.cpp
More file actions
37 lines (33 loc) · 758 Bytes
/
Copy pathBusToUdayland.cpp
File metadata and controls
37 lines (33 loc) · 758 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
#include<iostream>
using namespace std;
int main () {
int n, pair = 0;
cin>>n;
string arr[n];
for (int i = 0; i < n; i++) {
string s;
cin>>s;
if (s[0] == 'O' && s[1] == 'O' && pair == 0) {
pair++;
s[0] = '+';
s[1] = '+';
} else if (s[3] == 'O' && s[4] == 'O' && pair == 0) {
pair++;
s[3] = '+';
s[4] = '+';
}
arr[i] = s;
}
if (pair == 0) {
cout<<"NO";
} else {
cout<<"YES\n";
for (int i = 0; i < n; i++) {
cout<<arr[i]<<"\n";
}
}
return 0;
}
//Codeforces Problem: Bus to Udayland
//Status: Accepted
//Link: https://codeforces.com/problemset/problem/711/A