模拟。

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<ctime>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi=acos(-1.0);
void File()
{
freopen("D:\\in.txt","r",stdin);
freopen("D:\\out.txt","w",stdout);
}//.
template <class T>
inline void read(T &x)
{
char c = getchar();
x = ;
while(!isdigit(c)) c = getchar();
while(isdigit(c))
{
x = x * + c - '';
c = getchar();
}
} int n;
char s[]; int main()
{
cin>>n;
cin>>s;
int len=strlen(s);
for(int i=;i<len;)
{
if(s[i]=='o')
{
int j;
for(j=i+;j<len;)
{
if(j<len&&j+<len&&s[j]=='g'&&s[j+]=='o') j=j+;
else break;
} if(i+==j)
{
printf("%c",s[i]);
i=j;
}
else
{
printf("***");
i=j;
} }
else
{
printf("%c",s[i]);
i++;
}
}
return ;
}

CodeForces 738A Interview with Oleg的更多相关文章

  1. Interview with Oleg

    Interview with Oleg time limit per test 1 second memory limit per test 256 megabytes input standard ...

  2. 【Codeforces 738A】Interview with Oleg

    http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...

  3. 【57.97%】【codeforces Round #380A】Interview with Oleg

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  4. [CF738A]Interview with Oleg(模拟)

    题目链接:http://codeforces.com/contest/738/problem/A 题意:把ogo..ogo替换成***. 写的有点飘,还怕FST.不过还好 #include <b ...

  5. codeforces 631A Interview

    A. Interview time limit per test 1 second memory limit per test 256 megabytes input standard input o ...

  6. Codeforces 631A Interview【模拟水题】

    题意: 模拟模拟~~ 代码: #include<iostream> using namespace std; const int maxn = 1005; int a[maxn], b[m ...

  7. CF729A Interview with Oleg 题解

    Content 给出一个长度为 \(n\) 字符串 \(s\),请将开头为 \(\texttt{ogo}\),后面带若干个 \(\texttt{go}\) 的子串替换成 \(\texttt{***}\ ...

  8. Codeforces Round #344 (Div. 2) A. Interview 水题

    A. Interview 题目连接: http://www.codeforces.com/contest/631/problem/A Description Blake is a CEO of a l ...

  9. Codeforces Round #344 (Div. 2) A. Interview

    //http://codeforces.com/contest/631/problem/Apackage codeforces344; import java.io.BufferedReader; i ...

随机推荐

  1. 温习js中对象的继承

    温故而知新 XD 1. 关于原型和构造函数的几个知识要点: 使用new 操作符调用构造函数,会经历以下四个步骤: 1.1. 创建一个新对象: 1.2. 将构造函数的作用域赋给新对象(因此 this 就 ...

  2. Babel 和 PostCss 的一些基本配置

    Babel 是一个javascript编译器,PostCSS 是一个样式转换工具.两者都可以看作是一个转化平台,我们可以在上面使用一些插件,来达到想要的代码转化.几乎每个前端项目都要使用它们. Bab ...

  3. Linux LVM分区管理、扩展

    一.LVM简介 LVM是 Logical Volume Manager(逻辑卷管理)的简写.LVM将一个或多个硬盘的分区在逻辑上集合,相当于一个大硬盘来使用,当硬盘的空间不够使用的时候,可以继续将其它 ...

  4. Jenkins有用的插件

    1. Multijob plugin: 多个任务同时运行 2. ssh slave plugin: 用于安装slave? Allows to launch over ssh, using a java ...

  5. HDU5852 Intersection is not allowed!

    There are K pieces on the chessboard. The size of the chessboard is N*N. The pieces are initially pl ...

  6. jsp之jstl核心标签库

    JSTL核心标签库技术 1. JSTL介绍 在JSP页面中即可书写html,也可以书写Java代码,导致页面混乱,维护,修改,升级难度加大,于是国际上不同的公司在实际应用中,根据页面的需求将Java代 ...

  7. Java多线程学习(三)volatile关键字

    转载请备注地址:https://blog.csdn.net/qq_34337272/article/details/79680693 系列文章传送门: Java多线程学习(一)Java多线程入门 Ja ...

  8. Django-【views】decorators.csrf

      views下导入方法 from django.views.decorators.csrf import csrf_exempt,csrf_protect csrf_exempt是全局需要,唯独这个 ...

  9. Django rest framework 版本控制(源码分析)

    基于上述分析 #2.处理版本信息 处理认证信息 处理权限信息 对用户的访问频率进行限制 self.initial(request, *args, **kwargs) #2.1处理版本信息 #versi ...

  10. MVC使用Newtonsoft无需实体类,实现JSON数据返回给前端页面使用

    //引用using Newtonsoft.Json; using Newtonsoft.Json.Linq; public ActionResult JsonSample() { ResponseRe ...