[CF738A]Interview with Oleg(模拟)】的更多相关文章

题目链接:http://codeforces.com/contest/738/problem/A 题意:把ogo..ogo替换成***. 写的有点飘,还怕FST.不过还好 #include <bits/stdc++.h> using namespace std; ; int n, m; char s[maxn]; char t[maxn]; int main() { // freopen("in", "r", stdin); while(~scanf(&…
Interview with Oleg time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus,…
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a string s consisting of n lowercase English letters. There is…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a…
模拟. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<map> #include<set> #include<queue> #incl…
Content 给出一个长度为 \(n\) 字符串 \(s\),请将开头为 \(\texttt{ogo}\),后面带若干个 \(\texttt{go}\) 的子串替换成 \(\texttt{***}\),然后输出. 数据范围:\(1\leqslant n\leqslant 100\). Solution 我们考虑遍历每个字符,如果这个字符是 \(\texttt{o}\),并且后面两个字符是 \(\texttt{go}\),那么直接替换成 \(\texttt{***}\),并且往后搜有没有 \(\…
题意: 模拟模拟~~ 代码: #include<iostream> using namespace std; const int maxn = 1005; int a[maxn], b[maxn], fa[maxn], fb[maxn]; int main (void) { int n;cin>>n; for(int i = 1; i <= n; i++){ cin>>a[i]; if(i==1) fa[i] = a[i]; else fa[i] = fa[i-1…
原文 Node.js Interview Questions for 2017 什么是error-first callback? 如何避免无止境的callback? 什么是Promises? 用什么工具来保证代码的一致性风格? 为什么保持一致性风格很重要? When should you npm and when yarn? 什么是stub? 举个例子! 什么是test pyramid? 举个例子! 你喜欢哪个HTTP框架,为什么? 如何保护你的HTTP cookies 不遭受XSS攻击? 如何…
作者:Glowin链接:https://zhuanlan.zhihu.com/p/22881223来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. 原文地址:Google Interview University 原文作者:John Washam 译文出自:掘金翻译计划 (翻译不易,欢迎 Star 支持) 译者:Aleen,Newton,bobmayuze,Jaeger,sqrthree 这是? 这是我为了从 web 开发者(自学.非计算机科学学位)蜕变至 Goog…
Cracking the Coding Interview(Stacks and Queues) 1.Describe how you could use a single array to implement three stacks. 我的思路:一般堆栈的实现会利用一个数组,这里一个数组若实现3个堆栈,直接考虑把数组划分为3个部分,相当于3个独立的数组,所以就有以下的实现. 但是,这种实现方式的缺点在于均分了每个stack需要的space,但是事先无法确定每个stack是否需要更多的spac…