博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
codeforces 711A A. Bus to Udayland(水题)
阅读量:4327 次
发布时间:2019-06-06

本文共 1269 字,大约阅读时间需要 4 分钟。

题目链接:

题意:

找一对空位坐下来,水;

思路:

 

AC代码:

#include 
#include
#include
#include
#include
#include
#include
#include
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
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
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;}

  

转载于:https://www.cnblogs.com/zhangchengc919/p/5820628.html

你可能感兴趣的文章
4.Dotnet-Core部署到IIS
查看>>
Guitar and Music Theory
查看>>
用SQL命令查看Mysql数据库大小
查看>>
关于 Python
查看>>
贝叶斯网络
查看>>
SpringBoot整合ElasticSearch实现多版本的兼容
查看>>
ajax url参数中文乱码解决
查看>>
Thread Runnable 区别
查看>>
ORACLE JOB 设置
查看>>
微信小程序想要最短服务路径
查看>>
HDU - 4812 D Tree 点分治
查看>>
POJ 2763 Housewife Wind
查看>>
MinGW安装与配置
查看>>
【UVA11806 Cheerleaders】 题解
查看>>
TCP三次握手和四次挥手
查看>>
【SVN】win7 搭建SVN服务器
查看>>
iOS第三方做滤镜最主流的开源框架GPUImage
查看>>
面向对象三大特性
查看>>
网络架构与七层参考模式简介
查看>>
用python实现经典排序
查看>>