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

正则表达式基本应用

#include<bits/stdc++.h>
using namespace std;
int n, i;
string s, t;
int main() {
//freopen("in.txt", "r", stdin);
cin >> n; while (n--)cin >> s, t += s + "\n";//将字符累加到一个大字符串中
i = t.find("OO");//也可以用match替换
if (i >= 0)t.replace(i, 2, "++"), cout << "YES" << endl << t;
else cout << "NO";
return 0;
}

Codeforce Problem 711A - Bus to Udayland (正则表达式)的更多相关文章

  1. 【模拟】Codeforces 711A Bus to Udayland

    题目链接: http://codeforces.com/problemset/problem/711/A 题目大意: N个字符串,每个字符串5位,找到第一个出现两个OO的并改成++输出YES和改后字符 ...

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

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

  3. CodeForces 711A Bus to Udayland

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

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

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

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. A. Bus to Udayland

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  9. 洛谷 题解 CF711A 【Bus to Udayland】

    先用一个字符数组存每行的座位情况(字符变量也可以) 接下来用另一个数组存最后的座位情况 好了,看代码 #include<iostream> using namespace std; boo ...

  10. Ural 1011. Conductors

    1011. Conductors Time limit: 2.0 secondMemory limit: 64 MB Background Everyone making translations f ...

随机推荐

  1. 【Android】Android Bmob后端云配置

    简介 开发一个具有网络功能的应用,在Bmob移动应用云存储平台中,只需要注册一个账号,就可以实现申请创建任意多个数据库,获得对应的key,下载对应版本的SDK,并嵌入到移动应用中,调用存取的KPI,进 ...

  2. .NET周刊【11月第4期 2023-11-26】

    国内文章 万字长文:从 C# 入门学会 RabbitMQ 消息队列编程 https://www.cnblogs.com/whuanle/p/17837034.html 如题,详细的介绍RabbitMQ ...

  3. uni-app全局样式和局部样式

    前言 好,经过上个章节的介绍完毕之后,了解了一下 UniApp 的一个全局 页面配置文件,也就是我们的一个 pages.json 文件. 那么了解完了这个文件之后,这片文章,再了解一下 UniApp ...

  4. PWA 离线方案研究报告

    本文并不是介绍如何将一个网页配置成离线应用并支持安装下载的.研究PWA的目的仅仅是为了保证用户的资源可以直接从本地加载,来忽略全国或者全球网络质量对页面加载速度造成影响.当然,如果页面上所需的资源,除 ...

  5. CompletableFuture进阶

    CompletableFuture进阶 1.异步任务的交互 异步任务交互指将异步任务获取结果的速度相比较,按一定的规则( 先到先用 )进行下一步处理. 1.1 applyToEither applyT ...

  6. Java线程池ThreadPoolExecutor源码解析

    Java线程池ThreadPoolExecutor源码解析 1.ThreadPoolExecutor的构造实现 以jdk8为准,常说线程池有七大参数,通常而言,有四个参数是比较重要的 public T ...

  7. ElasticSearch之Delete index API

    删除指定的索引. 同时删除索引关联的数据.分片.元数据等相关的资源,因此执行前需要慎重. 命令样例如下: curl -X DELETE "https://localhost:9200/tes ...

  8. PyTorch项目源码学习(1)

    PyTorch PyTorch是一个开源的深度学习框架,项目地址 https://github.com/pytorch/pytorch 在学术工作中的使用频率较高.其主体由C++开发,PyTorch是 ...

  9. 新版以太坊Ethereum库ethersV5.0配合后端Golang1.18实时链接区块链钱包(Metamask/Okc)以及验签操作

    区块链去中心化思想无处不在,比如最近使用个体抗原自检替代大规模的中心化核酸检测,就是去中心化思想的落地实践,避免了大规模聚集导致的交叉感染,提高了检测效率,本次我们使用Ethereum最新的ether ...

  10. OBS鉴权实现的宝典秘籍,速拿!

    摘要:OBS提供了REST(Representational State Transfer)风格API,支持您通过HTTP/HTTPS请求调用.本文将带你了解OBS API鉴权实现的宝典秘籍. OBS ...