题目链接:

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

题目大意:

  N个字符串,每个字符串5位,找到第一个出现两个OO的并改成++输出YES和改后字符串,没有输出NO.

题目思路:

  【模拟】

  签到题。看阅读理解能力和手速。

 //
//by coolxxx
//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<memory.h>
#include<time.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//#include<stdbool.h>
#include<math.h>
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(a) ((a)>0?(a):(-(a)))
#define lowbit(a) (a&(-a))
#define sqr(a) ((a)*(a))
#define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b))
#define mem(a,b) memset(a,b,sizeof(a))
#define eps (1e-8)
#define J 10
#define mod 1000000007
#define MAX 0x7f7f7f7f
#define PI 3.14159265358979323
#define N 1004
using namespace std;
typedef long long LL;
int cas,cass;
int n,m,lll,ans;
char s[N][];
int main()
{
#ifndef ONLINE_JUDGE
// freopen("1.txt","r",stdin);
// freopen("2.txt","w",stdout);
#endif
int i,j,k; // for(scanf("%d",&cass);cass;cass--)
// for(scanf("%d",&cas),cass=1;cass<=cas;cass++)
// while(~scanf("%s",s+1))
while(~scanf("%d",&n))
{
for(i=;i<=n;i++)
scanf("%s",s[i]);
for(i=;i<=n;i++)
{
if(s[i][]==s[i][] && s[i][]=='O')
{
s[i][]=s[i][]='+';
break;
}
else if(s[i][]==s[i][] && s[i][]=='O')
{
s[i][]=s[i][]='+';
break;
}
}
if(i<=n)
{
puts("YES");
for(i=;i<=n;i++)
puts(s[i]);
}
else puts("NO");
}
return ;
}
/*
// //
*/

【模拟】Codeforces 711A Bus to Udayland的更多相关文章

  1. CodeForces 711A Bus to Udayland (水题)

    题意:给定一个n*4的矩阵,然后O表示空座位,X表示已经有人了,问你是不能找到一对相邻的座位,都是空的,并且前两个是一对,后两个是一对. 析:直接暴力找就行. 代码如下: #pragma commen ...

  2. CodeForces 711A Bus to Udayland

    简单题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #inclu ...

  3. codeforces 711A A. Bus to Udayland(水题)

    题目链接: A. Bus to Udayland 题意: 找一对空位坐下来,水; 思路: AC代码: #include <iostream> #include <cstdio> ...

  4. Codeforces Round #369 (Div. 2) A. Bus to Udayland 水题

    A. Bus to Udayland 题目连接: http://www.codeforces.com/contest/711/problem/A Description ZS the Coder an ...

  5. Codeforces Round #369 (Div. 2) A. Bus to Udayland (水题)

    Bus to Udayland 题目链接: http://codeforces.com/contest/711/problem/A Description ZS the Coder and Chris ...

  6. Codeforces Round #369 (Div. 2) A. Bus to Udayland【字符串/二维字符数组求连起来的座位并改为其他字符】

    A. Bus to Udayland time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  7. 贪心+模拟 Codeforces Round #288 (Div. 2) C. Anya and Ghosts

    题目传送门 /* 贪心 + 模拟:首先,如果蜡烛的燃烧时间小于最少需要点燃的蜡烛数一定是-1(蜡烛是1秒点一支), num[g[i]]记录每个鬼访问时已点燃的蜡烛数,若不够,tmp为还需要的蜡烛数, ...

  8. 模拟 Codeforces Round #203 (Div. 2) C. Bombs

    题目地址:http://codeforces.com/problemset/problem/350/C /* 题意:机器人上下左右走路,把其他的机器人都干掉要几步,好吧我其实没读懂题目, 看着样例猜出 ...

  9. 模拟 Codeforces Round #249 (Div. 2) C. Cardiogram

    题目地址:http://codeforces.com/contest/435/problem/C /* 题意:给一组公式,一组数据,计算得到一系列的坐标点,画出折线图:) 模拟题:蛮恶心的,不过也简单 ...

随机推荐

  1. HTML的Get方法URL传递中文参数,解决乱码问题

    本例中有使用JQuery. 资料参考:http://www.cnblogs.com/babycool/p/3169058.html 发送的HTML页面代码: <!DOCTYPE html> ...

  2. 10.31 afternoon

    巧克力棒(chocolate)Time Limit:1000ms Memory Limit:64MB题目描述LYK 找到了一根巧克力棒,但是这根巧克力棒太长了, LYK 无法一口吞进去.具体地,这根巧 ...

  3. PHP 中xampp不能启动服务器的问题

    有时候别人电脑上面的XAMPP,你把安装文件拷贝下来后,会发现,自己的电脑上用不了 这个时候有很多种情况 1. 关闭你自己电脑上有可能暂用80端口的程序 2.D:\xampp\apache\conf\ ...

  4. spring验证事务的代码,用到了mockito

    package *.withdraw; import javax.annotation.Resource; import org.junit.Before; import org.junit.Test ...

  5. if elsif;报错;new赋值

    1. IF INSERTING THEN          BEGIN 中间不能为空          END;ELSIF DELETING THEN         BEGIN          E ...

  6. 重要性!important

    我们在做网页代码的时,有些特殊的情况需要为某些样式设置具有最高权值,怎么办?这时候我们可以使用!important来解决. 如下代码: p{color:red!important;} p{color: ...

  7. JavaScript HTML DOM EventListener

    JavaScript HTML DOM EventListener addEventListener() 方法 实例 点用户点击按钮时触发监听事件: document.getElementById(& ...

  8. 计算机网络基础_01IP地址

    1,IP地址组成和分级分级 IP地址=网络地址+主机地址 32位,4段组成 A:最高位是0 ,1个字节的网络地址,3个字节的主机地址 B:最高位是10,2个字节的网络地址,2个字节的主机地址 C:最高 ...

  9. python everything is object

    python面向对象非常彻底,即使过程式的代码风格,python在运作的时候也是面向对象的.everything is object. 差异 在面向对象的理念上,python和非常工程化的面向对象语言 ...

  10. linux 日常命令(磁盘空间)

    df –hl 在windows下可以很方便的查看磁盘空间的.但是到了Linux查看磁盘空间,你可能就有点摸不着头脑了,呵呵.不要急,我这就要给你解决这个问题. Df命令是Linux查看磁盘空间系统以磁 ...