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. 图片转换网站推荐(BMP格式作业)

    做选做作业时我发现我的PS不能保存为BMP格式 只好网上搜索,发现了一个不错的免费网站 图片转换

  2. AntDesignBlazor示例——创建列表页

    本示例是AntDesign Blazor的入门示例,在学习的同时分享出来,以供新手参考. 示例代码仓库:https://gitee.com/known/AntDesignDemo 1. 学习目标 使用 ...

  3. games101-2 透视深度插值矫正与抗锯齿分析

    透视深度插值矫正与抗锯齿分析 深度插值的差错原因 透视深度插值公式推导 games101中的错误 msaa与ssaa简要定义 games101中ssaa的实现 games101中msaa的实现 深度插 ...

  4. 【MRCTF2020】Ezpop_Revenge——PHP原生类SSRF

    [MRCTF2020]Ezpop_Revenge--PHP原生类SSRF 1. 收获 CMS初审计 google.baidu hack PHP原生类反序列化 2. 看题 2.1 读源码 网页存在源码泄 ...

  5. C#中的并行处理、并行查询的方法你用对了吗?

    Parallel.ForEach Parallel.ForEach 是一个用于在集合上并行执行迭代操作的强大工具.它通过有效地利用多核处理器的能力来提高性能.Parallel.ForEach 不仅能够 ...

  6. .NET Conf 2023 Chengdu - 成都站圆满结束!

    今年的.NET Conf 2023,中国区首次有两个会场举办Local Event,成都会场已于上周六12月9日圆满结束. 本次成都会场共计100+余名.NET开发者报名参与,共计10+名志愿者参与筹 ...

  7. [ABC235G] Gardens

    Problem Statement Takahashi has $A$ apple seedlings, $B$ banana seedlings, and $C$ cherry seedlings. ...

  8. Selenium查找元素、元素的属性和方法

    查找元素 官方文档:https://www.selenium.dev/documentation/webdriver/elements/locators/ 一般通过find_element或者find ...

  9. 为什么许多数字孪生产品开始了GIS融合的尝试?

    随着数字孪生技术的发展,越来越多的产品意识到要实现数字孪生的最大价值,需要考虑多个维度的数据,包括空间信息.地理位置.环境条件等.因此,许多数字孪生产品开始了与GIS系统的融合尝试,以进一步提升其功能 ...

  10. NLP复习之N元文法

    N元文法的统计 二元概率方程: \[P(w_n|w_{n-1}) = \frac{C(w_{n-1}w_n)}{C(w_{n-1})} \] 三元概率估计方程: \[P(w_n|w_{n-2},w_{ ...