Codeforces_#370 (Div. 2)_A

http://codeforces.com/problemset/problem/711/A

忙了一天没做题,做到水题,我这水平也只能做水题了= = !

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[1005][8];
int main()
{
    int n;
    scanf("%d",&n);
    getchar();
    int flag = 1;
    for(int i = 1;i <= n;i++)
    {
        gets(a[i]);
        if(flag)
        {
            if(a[i][0] == ‘O‘ && a[i][1] == ‘O‘)
            {
                flag = 0;
                a[i][0] = ‘+‘;
                a[i][1] = ‘+‘;
            }
            else if(a[i][3] == ‘O‘ && a[i][4] == ‘O‘)
            {
                flag = 0;
                a[i][3] = ‘+‘;
                a[i][4] = ‘+‘;
            }
        }
    }
    if(!flag)
    {
        printf("YES\n");
        for(int i = 1;i <= n;i++)   puts(a[i]);
    }
    else        printf("NO\n");
    return 0;
}
时间: 2025-02-01 02:01:59

Codeforces_#370 (Div. 2)_A的相关文章

codeforces_#243 (Div.2)

A题,426A,Sereja and Mugs 题目意思:有n-1个小伙伴,n个杯子,里面分别装有水,每个小伙伴可以选择一杯水,问总共加起来会不会超过给的S 解题思路: 这个还要说吗? /************************************************************************* > File Name: 1.cpp > Author: boblee > Mail: [email protected] > Created Tim

Codeforces Round #370(div 2)

A B C :=w= D:两个人得分互不影响很关键 一种是f[i][j]表示前i轮,分差为j的方案数 明显有f[i][j]=f[i-1][j-2k]+2*f[i-1][j-2k+1]+...+(2k+1)f[i-1][j]+... 枚举是K*T*T,转移是K 超时 不过发现转移的时候可以理解为j是j-1的算式的整个区间移动,于是可以维护f[i-1]的前缀和来达到O(1)的转移 另一种f[i][j]表示前i轮,某个人分数为j的方案数(两人互不影响,无先后手之分,所以两人等价) 式子写出来就少了第一

Codeforces Round #370 (Div. 2) D. Memory and Scores DP

D. Memory and Scores Memory and his friend Lexa are competing to get higher score in one popular computer game. Memory starts with score a and Lexa starts with score b. In a single turn, both Memory and Lexa get some integer in the range [ - k;k] (i.

Codeforces_AIM Tech Round 3 (Div. 1)_A

http://codeforces.com/problemset/problem/708/A 贪心,先把前面连续的一串'a'排除,再向后知道找到第一个'a',注意特殊情况. #include<iostream> #include<cstdio> #include<string> using namespace std; int main() { string s; cin >> s; int i; for(i = 0;i < s.size() &

Codeforces Round #370 (Div. 2) C

Description Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilateral triangle of side length y. In a single

Codeforces Round #370 (Div. 2) B

Description Memory is performing a walk on the two-dimensional plane, starting at the origin. He is given a string s with his directions for motion: An 'L' indicates he should move one unit left. An 'R' indicates he should move one unit right. A 'U'

css+div学习

first: 1 <!DOCTYPE html> 2 <html> 3 <head lang="en"> 4 <meta charset="UTF-8"> 5 <title></title> 6 <style> 7 body { 8 margin: 0; /*设置外边距为0*/ 9 text-align: center; 10 background-color: #ffffcc; 1

PostCSS 实战

专题截图: 项目截图: 目录说明: dest/ 发布代码文件夹: src/              预编译代码文件夹; node_modules    node 插件; gulpfile.js           gulp的配置文件; package.json      npm 配置文件; src/待编译文件夹: c/        css文件目录; i/ img文件目录; dest/发布文件夹: c/        css文件目录; i/ img文件目录; package.json 文件展示

男神女神配 社区交友网 —— 之 主页 详细解说

一.项目背景 1. 开发平台.开发工具 (1)后台数据库采用:MySQL Workbench 6.1 CE. (2)代码编写平台采用:Eclipse Java EE IDE for Web Developers:HBuilder:eclipse:IntelliJ IDEA 14.1.1. (3)主要插件:jdk1.6.0_10:mysql-connector-java-5.1.30-bin.jar:apache-tomcat-7.0.54:SpringExample03:apache-maven