codeforces 711A A. Bus to Udayland(水题)
题目链接:
题意:
找一对空位坐下来,水;
思路:
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <bits/stdc++.h>
#include <stack>
#include <map> using namespace std; #define For(i,j,n) for(int i=j;i<=n;i++)
#define mst(ss,b) memset(ss,b,sizeof(ss)); typedef long long LL; template<class T> void read(T&num) {
char CH; bool F=false;
for(CH=getchar();CH<'0'||CH>'9';F= CH=='-',CH=getchar());
for(num=0;CH>='0'&&CH<='9';num=num*10+CH-'0',CH=getchar());
F && (num=-num);
}
int stk[70], tp;
template<class T> inline void print(T p) {
if(!p) { puts("0"); return; }
while(p) stk[++ tp] = p%10, p/=10;
while(tp) putchar(stk[tp--] + '0');
putchar('\n');
} const LL mod=1e9+7;
const double PI=acos(-1.0);
const int inf=1e9;
const int N=1e5+20;
const int maxn=4e3+220;
const double eps=1e-12; char s[2000][10]; int main()
{
int n,flag=0;
read(n);
For(i,1,n)scanf("%s",s[i]);
For(i,1,n)
{
if(s[i][0]=='O'&&s[i][1]=='O')
{
flag=1;
s[i][0]='+';
s[i][1]='+';
break;
}
if(s[i][3]=='O'&&s[i][4]=='O')
{
flag=1;
s[i][3]='+';
s[i][4]='+';
break;
}
}
if(flag)
{
cout<<"YES\n";
For(i,1,n)
{
for(int j=0;j<=4;j++)printf("%c",s[i][j]);
printf("\n");
}
}
else cout<<"NO\n";
return 0;
}
codeforces 711A A. Bus to Udayland(水题)的更多相关文章
- 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 ...
- CodeForces 711A Bus to Udayland (水题)
题意:给定一个n*4的矩阵,然后O表示空座位,X表示已经有人了,问你是不能找到一对相邻的座位,都是空的,并且前两个是一对,后两个是一对. 析:直接暴力找就行. 代码如下: #pragma commen ...
- Educational Codeforces Round 7 B. The Time 水题
B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the curr ...
- Educational Codeforces Round 7 A. Infinite Sequence 水题
A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...
- Codeforces Testing Round #12 A. Divisibility 水题
A. Divisibility Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/probl ...
- Codeforces Beta Round #37 A. Towers 水题
A. Towers 题目连接: http://www.codeforces.com/contest/37/problem/A Description Little Vasya has received ...
- codeforces 677A A. Vanya and Fence(水题)
题目链接: A. Vanya and Fence time limit per test 1 second memory limit per test 256 megabytes input stan ...
- CodeForces 690C1 Brain Network (easy) (水题,判断树)
题意:给定 n 条边,判断是不是树. 析:水题,判断是不是树,首先是有没有环,这个可以用并查集来判断,然后就是边数等于顶点数减1. 代码如下: #include <bits/stdc++.h&g ...
- Codeforces - 1194B - Yet Another Crosses Problem - 水题
https://codeforc.es/contest/1194/problem/B 好像也没什么思维,就是一个水题,不过蛮有趣的.意思是找缺黑色最少的行列十字.用O(n)的空间预处理掉一维,然后用O ...
随机推荐
- 不变(Invariant), 协变(Covarinat), 逆变(Contravariant) : 一个程序猿进化的故事
阿袁工作的第1天: 不变(Invariant), 协变(Covarinat), 逆变(Contravariant)的初次约 阿袁,早!开始工作吧. 阿袁在笔记上写下今天工作清单: 实现一个scala类 ...
- 最全面的jdbcUtils,总有一种适合你
附加jar包,TxQueryRunner.java文件,dbconfig.properties配置文件(点击链接下载): http://files.cnblogs.com/files/xiaoming ...
- virtualenv and virtualenvwrapper on Ubuntu 14.04
In this post I’ll go over my attempt to setup virtual environments for Python development. Most Pyth ...
- FEE Development Essentials
FEE Development Essentials JS Basic function call() and apply() func1.bind(thisObj,arg1...argn) Cust ...
- Matlab2014a 提示未找到支持的编译器或 SDK的解决方法
最近在写论文,用到了matlab版本的libsvm,在混合编译的时候遇到的一点小问题. 我电脑上装的是matlab2014a,window7 64位 >> mbuild -setup 错误 ...
- 我的GTD中收集的书单
在几年的GTD过程中,收集了一些想读的书目,没有系统地整理,每当读完一本之后,就翻翻书单,寻找下一本感兴趣的书,书是不可能读完的,只能找有兴趣的.符合自己目标方向的.有些书记录了豆瓣上的评分,虽然不是 ...
- Python基础(11)--面向对象1
面向对象设计与面向对象编程的关系 面向对象设计(OOD)不会特别要求面向对象编程语言.事实上,OOD 可以由纯结构化语言来实现,比如 C,但如果想要构造具备对象性质和特点的数据类型,就需要在程序上作更 ...
- MyBatis入门(三)---多个参数
一.建立表 1.1.建立表,并插入数据 /* SQLyog Enterprise v12.09 (64 bit) MySQL - 5.6.27-log : Database - mybatis *** ...
- oracle 表空间使用情况
--表空间使用情况 SELECT a.tablespace_name "表空间名", round(total/1024/1024,2) "表空间大小", rou ...
- OC语言-06-OC语言-block与protocol
一.block 1> 基本使用 相当于用来存放代码的代码块 效率高 若没有形参可以省略小括号 2> block与函数的相同点 可以保存代码 可以有返回值 可以有形参 调用方式一样 3> ...