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. day01预习-基本语法

    typora-copy-images-to: media 基本语法 JavaScript的历史: ​ 在95年以前,就有很多上网的用户了,当时的带宽只有28.8kb/s,用户要进行表单的验证时,点击提 ...

  2. 手撕Vue-Router-实现router-link

    前言 在上一篇 [手撕Vue-Router-添加全局$router属性] 中,实现了将每一个 Vue 实例上挂载一个 $router 属性,这个属性就是我们在上一篇文章中创建的 VueRouter 实 ...

  3. .NET8极致性能优化CHRL

    前言 .NET8在.NET7的基础上进行了进一步的优化,比如CHRL(全称:CORINFO_HELP_RNGCHKFAIL)优化技术,CORINFO_HELP_RNGCHKFAIL是边界检查,在.NE ...

  4. Java并发(十六)----线程八锁

    所谓的"线程八锁" 其实就是看 synchronized 锁住的是哪个对象 情况1:12 或 21都是有可能的,就看cpu先调度哪个线程 @Slf4j(topic = " ...

  5. [USACO2007NOVG] Telephone Wire G

    题目描述 Farmer John's cows are getting restless about their poor telephone service; they want FJ to rep ...

  6. 算法那么多,AI量化交易策略如何选择最佳算法?

    常见算法优劣比较 算法没有最好,只有更好. 这个问题的答案取决于许多因素,例如股票市场的条件,数据集的质量和特征工程的有效等.接下来,我们来看看这些算法的优势和劣势: 神经网络:适用于复杂的非线性问题 ...

  7. Java8函数式编程应用

    我们经常提到,Java8是革命性的一个版本,原因就是正式引入了函数式编程,那Java的函数式编程在实际应用中到底有什么用呢?结合实际的应用,我整理出了函数式在Java的几个经典用途. 缓求值 惰性求值 ...

  8. 前端异步编程 —— Promise对象

    在前端编程中,处理一些简短.快速的操作,在主线程中就可以完成. 但是,在处理一些耗时比较长以至于比较明显的事情,比如读取一个大文件或者发出一个网络请求,就需要异步编程来实现,以避免只用主线程时造成页面 ...

  9. 开源MES/免费MES/开源mes 生产管理流程

    开源MES/免费MES/开源MES生产流程管理 一.什么是MES生产管理流程 生产管理系统(又称制造执行系统)是一种集成了计划.生产.质量控制.库存管理和材料申请等生产流程的管理系统.工厂生产管理流程 ...

  10. Spring Cloud 学习推荐

    学习 Spring Boot Spring tutorials | Java Web Development, Spring Cloud Programming tutorials Spring Bo ...