题目链接:http://codeforces.com/contest/738/problem/A

题意:把ogo..ogo替换成***。

写的有点飘,还怕FST。不过还好

 #include <bits/stdc++.h>
using namespace std; const int maxn = ;
int n, m;
char s[maxn];
char t[maxn]; int main() {
// freopen("in", "r", stdin);
while(~scanf("%d", &n)) {
scanf("%s", s);
m = ;
memset(t, , sizeof(t));
for(int i = ; s[i]; i++) {
if(s[i] == 'o') {
int j = i;
while() {
if(s[j+] == 'g' && s[j+] == 'o') j += ;
else break;
}
if(j != i) {
t[m++]='*'; t[m++]='*'; t[m++]='*';
i = j;
} else t[m++] = s[i];
} else t[m++] = s[i];
}
puts(t);
}
return ;
}

[CF738A]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. CodeForces 738A Interview with Oleg

    模拟. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #includ ...

  5. CF729A Interview with Oleg 题解

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

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

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

  7. [译]Node.js Interview Questions and Answers (2017 Edition)

    原文 Node.js Interview Questions for 2017 什么是error-first callback? 如何避免无止境的callback? 什么是Promises? 用什么工 ...

  8. Google Interview University - 坚持完成这套学习手册,你就可以去 Google 面试了

    作者:Glowin链接:https://zhuanlan.zhihu.com/p/22881223来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. 原文地址:Google ...

  9. Cracking the Coding Interview(Stacks and Queues)

    Cracking the Coding Interview(Stacks and Queues) 1.Describe how you could use a single array to impl ...

随机推荐

  1. 利用curl并发来提高页面访问速度

    在我们平时的程序中难免出现同时访问几个接口的情况,平时我们用curl进行访问的时候,一般都是单个.顺序访问,假如有3个接口,每个接口耗时500毫 秒那么我们三个接口就要花费1500毫秒了,这个问题太头 ...

  2. 鸟哥的linux私房菜学习记录之正则表达式

    正则表达式具有强大的字符串处理能力,常常用来搜索删除和替换字符串,用途很广. sed awk数据处理工具 diff,cmp,patch,pr文档对比工具

  3. Sublime Text 3 常用插件以及安装方法

    安装Sublime Text 3插件的方法: 一.直接安装 安装Sublime text 2插件很方便,可以直接下载安装包解压缩到Packages目录(菜单->preferences->p ...

  4. jenkins+jmeter+ant搭建接口测试平台

    接口测试的重点是检查数据的交换,传递和控制管理过程以及系统间的相互逻辑依赖关系. 接口测试的流程 项目启动后,测试人员要尽早拿到接口测试文档. 开始编写接口测试用例 将接口测试用例部署到持续集成的测试 ...

  5. 通过SQL Server Profiler来监视分析死锁

    在两个或多个SQL Server进程中,每一个进程锁定了其他进程试图锁定的资源,就会出现死锁,例如,进程process1对table1持有1个排它锁(X),同时process1对table2请求1个排 ...

  6. Maven之Nexus构建企业级Maven仓库

    什么是Nexus? Nexus是Maven仓库管理器,用来搭建一个本地仓库服务器,这样做的好处是便于管理,节省网络资源,速度快,还有一个非常有用的功能就是可以通过项目的SNAPSHOT版本管理,来进行 ...

  7. Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead.

    这行代码: List<Cat> catList =session.createQuery("from Cat p where p.name.first_name=?") ...

  8. 每日一九度之 题目1033:继续xxx定律

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:5502 解决:1351 题目描述:     当n为3时,我们在验证xxx定律的过程中会得到一个序列,3,5,8,4,2,1,将3称为关键数, ...

  9. script中的if

    function isOK() { var isTrue = false; var value = $("#myTest1").val(); // if (value && ...

  10. ural 1112,LIS

    题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1112 题意:n根线段,要拿走一些,使得任何的线段的左段没有在某一个线段的内部. 其实说白 ...