首页 > 代码库 > Codeforces Round #369 (Div. 2)

Codeforces Round #369 (Div. 2)

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)