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

模拟. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<map> #include<set> #include<queue> #incl…
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…
题目链接: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(&…
A. Interview time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Blake is a CEO of a large company called "Blake Technologies". He loves his company very much and he thinks that his compan…
题意: 模拟模拟~~ 代码: #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…
Content 给出一个长度为 \(n\) 字符串 \(s\),请将开头为 \(\texttt{ogo}\),后面带若干个 \(\texttt{go}\) 的子串替换成 \(\texttt{***}\),然后输出. 数据范围:\(1\leqslant n\leqslant 100\). Solution 我们考虑遍历每个字符,如果这个字符是 \(\texttt{o}\),并且后面两个字符是 \(\texttt{go}\),那么直接替换成 \(\texttt{***}\),并且往后搜有没有 \(\…
A. Interview 题目连接: http://www.codeforces.com/contest/631/problem/A Description Blake is a CEO of a large company called "Blake Technologies". He loves his company very much and he thinks that his company should be the best. That is why every can…
//http://codeforces.com/contest/631/problem/Apackage codeforces344; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; /** * Created by lenovo on…
A. Interview time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Blake is a CEO of a large company called "Blake Technologies". He loves his company very much and he thinks that his compan…
[题目链接]:http://codeforces.com/contest/793/problem/A [题意] 每次你可以对1..n中的任意一个数字进行减少k操作; 问你最后可不可能所有的数字都变成一样的; 可能的话输出最小操作次数; [题解] a[x1]-k*x1=t a[x2]-k*x2=t x1是对a[x1]的操作次数..以此类推 则有 a[x1]-a[x2]=k*(x2-x1) 可知a[x1]-a[x2]必然为k的倍数否则无解; 则升序排; 相邻两个数字的差必然要求为k的倍数; 即%k=…
题意: 给定一个n*n的矩阵,一个格子上可以放一个车.其中有q个子矩阵,且q个子矩阵互不相交或者是重叠(但边界可以衔接).这q个子矩阵所覆盖的地方都是不能够放车的.车可以越过子矩阵覆盖的地方进行攻击(车可以横着或者是竖着直走,就像象棋中的那样).现在问的是一共最多能够放多少个不能够互相攻击的车. 数据范围 1<=n<=10000,0<=q<=10000 输入格式 首先输入两个数字n,q,分别表示矩阵的大小和子矩阵的个数. 接下来有q行,每行四个正整数x1,y1,x2,y2,分别表示…
目录 @description - translation@ @solution@ @part - 1@ @part - 2@ @part - 3@ @part - 4@ @accepted code@ @details@ @description - translation@ 给定一个 n*n 的棋盘,并划定一些不能放棋子的矩形区域. 现在要在棋盘上放最多的车(读作 ju),使得这些车两两之间不会攻击. input: 第一行整数 n --棋盘边长(1 <= n <= 10000). 第二行整…
Codeforces #344 Div.2 Interview 题目描述:求两个序列的子序列或操作的和的最大值 solution 签到题 时间复杂度:\(O(n^2)\) Print Check 题目描述:有一个棋盘,对其进行染色,每次染一行或一列,后来的颜色会覆盖原来的颜色,输出最后的棋盘. solution 题解用二维线段树,其实可以不用. 对染色进行离线操作,那么染过的格子.行.列就不用再染了.所以每个格子可以记录四个指针,分别是行前驱,行后继,列前驱列后继,染色时按照这个跳着来染就好了.…
http://codeforces.com/contest/794/problem/C Description Oleg the client and Igor the analyst are good friends. However, sometimes they argue over little things. Recently, they started a new company, but they are having trouble finding a name for the…
题意 现在有m个人,每一个人都特别喜欢狗.另外还有一棵n个节点的树. 现在每个人都想要从树上的某个节点走到另外一个节点,且满足要么这个人自带一条狗m,要么他经过的所有边h上都有一条狗. 2<=n<=2*10^4,1<=m<=10^4 输入格式 第一行为两个整数n,m,分别表示树的大小和人数. 接下来有n-1行,每一行有两个整数u,v,表示书上有一条u-v的边. 再接下来有m行,每一行两个整数x[i],y[i]表示第i个人想从x[i]走到y[i]. 输出格式 第一行为一个整数k,表示…
E. ZS and The Birthday Paradox 题目连接: http://www.codeforces.com/contest/711/problem/E Description ZS the Coder has recently found an interesting concept called the Birthday Paradox. It states that given a random set of 23 people, there is around 50% c…
I'll be sitting for an Amazon interview in 3 months. Which website should I use to practice: SPOJ, HackerRank, HackerEarth, CodeChef, Codeforces, or UVA?   Answer Request Follow231 Comment Share Downvote                             Promoted by Hired.…
A. Interview time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Blake is a CEO of a large company called "Blake Technologies". He loves his company very much and he thinks that his compan…
E. Danil and a Part-time Job 题目链接:http://codeforces.com/contest/877/problem/E time limit per test2 seconds memory limit per test256 megabytes Danil decided to earn some money, so he had found a part-time job. The interview have went well, so now he i…
题目描述: Prime Gift time limit per test 3.5 seconds memory limit per test 256 megabytes input standard input output standard output Opposite to Grisha's nice behavior, Oleg, though he has an entire year at his disposal, didn't manage to learn how to sol…
March 16, 2016 Problem statement:Given a 2D array (matrix) named M, print all items of M in a spiral order, clockwise.For example: M  =  1   2   3   4   5       6   7   8   9  10      11  12  13  14  15      16  17  18  19  20 The clockwise spiral pr…
http://www.topwcftutorials.net/2012/09/wcf-faqs-part2.html WCF Interview Questions – Part 2 This WCF tutorial is part-2 in series of WCF Interview Questions. Other parts in this series can be found here. 这是WCF问答系列教程中的第二部分,其他部分可以在下面的链接中找到: WCF Service…
http://www.topwcftutorials.net/2012/08/wcf-faqs-part1.html WCF Interview Questions – Part 1 This WCF Tutorial is a collection of most frequently asked interview questions about Windows Communication Foundation (WCF) covering the beginner to professio…
Amazon Interview | Set 27 Hi, I was recently interviewed for SDE1 position for Amazon and got selected. I have 1.5 year experience in java. Geeksforgeeks helped me lot. I am very thankful to Geeksforgeeks team. Following were interview questions- Two…
http://www.careerride.com/Swing-AWT-Interview-Questions.aspx   Swing interview questions and answers for freshers and experienced candidates. These interview questions and answers on Swing will help you strengthen your technical skills, prepare for t…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
Pramp - mock interview experience   February 23, 2016 Read the article today from hackerRank blog on facebook: http://venturebeat.com/2016/02/18/how-i-landed-a-google-internship-in-6-months/?utm_content=buffer5c137&utm_medium=social&utm_source=fac…
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of bconsecutive cells. No cell can be part of two ships, however, the shi…