A
#include <iostream> #include <vector> #include <queue> #include <cstdio> #include <cstdlib > #include <cstring> #include <cctype> #include <algorithm> #include <map> #include <set > #include <cmath>using namespace std;typedef unsigned long long Ull;char a[1050][5];int main () {//freopen (" Input.txt "," R ", stdin); Freopen ("Output.txt", "w", stdout); int x; CIN >> X; char c; int pop=0; for (int i=0;i<x;i++) {for (int j=0;j<5;j++) {scanf ("%c", &c); if (c>=65) {a[i][j]=c; } else j--; }}/*for (int i=0;i<x;i++) {for (int j=0;j<5;j++) {cout << a[i][j]; }}*/for (int i=0;i<x;i++) {if (a[i][0]== ' o ' &&a[i][1]== ' o ') {pop=1; a[i][0]=a[i][1]= ' + '; Break } if (a[i][3]== ' o ' &&a[i][4]== ' o ') {pop=1; a[i][3]=a[i][4]= ' + '; Break }} if (pop==0) printf ("NO"); else {printf ("YES"); for (int i=0; i<x;i++) {printf ("\ n"); for (int j=0;j<5;j++) {printf ("%c", A[i][j]); }}}//fclose (stdin); Fclose (stdout);}
Codeforces Round #369 (Div. 2)