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 ...
随机推荐
- question about import google file
1. question descibe; once, one css file(app.css) of my web project has sentence like this: @import u ...
- jquery function Optional Arguments
1.javascript 选项散列对象 function Test(p1,p2,p3,p4,p5){ //do something } call: 参数可选 Test({ p1:value1, p2: ...
- Linux Shell系列教程之(十四) Shell Select教程
本文是Linux Shell系列教程的第(十四)篇,更多Linux Shell教程请看:Linux Shell系列教程 在上一篇文章:Linux Shell系列教程之(十三)Shell分支语句case ...
- 干净的停止tomcat/java应用程序
通常在使用了jdbc或者netty的应用程序中,当shutdown tomcat或java应用程序时,会出现无法停止的情况,报类似如下错误: 严重: The web application [] re ...
- StackOverflow Update: 560M Pageviews A Month, 25 Servers, And It's All About Performance
http://highscalability.com/blog/2014/7/21/stackoverflow-update-560m-pageviews-a-month-25-servers-and ...
- 详解JavaScript函数模式
JavaScript设计模式的作用是提高代码的重用性,可读性,使代码更容易的维护和扩展.在javascript中,函数是一类对象,这表示他可以作为参数传递给其他函数:此外,函数还可以提供作用域. 创建 ...
- 利用ng-click、ng-switch和click-class制作切换的tabl
效果如下图,当分别点击1,2,3时,下面的不同颜色的div会切换 <html ng-app> <head> <title></title> <sc ...
- Cannot export AX project in AX7
I tried to export project from VS. I succeed before. But today I got a Microsoft Visual Studio err ...
- linq 动态组合条件
http://www.albahari.com/nutshell/predicatebuilder.aspx Dynamically Composing Expression Predicates S ...
- Android 开发组件
每一个应用程序都有自己独立的运行沙盒(授予应用程序代码的访问权) Android操作系统是一个多用户的Linux系统,其中的每一个应用程序都是一个独立的用户. 系统会为每一个应用程序分配一个唯一的Li ...