CodeForces - 879】的更多相关文章

题目链接:http://codeforces.com/contest/879/problem/D 题意:这题题意我反正是看了很久,可能是我的理解能力有点差,就是将一个数组倍增m倍然后将连续的相同的k个删除删到不能再删为止. 题解:这里m有点大肯定不能暴力所以可以考虑两个两个之间相互抵消比如 (1231) (1231) (1231) (1231) (1231) 第一部分的后半和第二部分的前半合并,第二部分后半和第三部分前半合并最后第一部分前半和最后一部分后半合并差不多就是这个意思然后就摸你一下就好…
A 题意:就是一共有n个医生,每个医生上班的时间是第Si天,之后每隔d天去上班,问最少多少天能够访问完这n名医生 思路:直接进攻模拟就可以 代码: 1 #include<iostream> 2 #include<algorithm> 3 #include<cstdio> 4 #include<cmath> 5 #include<cstring> 6 using namespace std; 7 const int maxx=1e5+10; 8 s…
Codeforces Round #443 (Div. 2) codeforces 879 A. Borya's Diagnosis[水题] #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int main(){ , s, d; scanf("%d", &n); while(n--) { scanf("%d%d", &a…
题目链接:http://codeforces.com/contest/879/problem/C C. Short Program time limit per test2 seconds memory limit per test256 megabytes Petya learned a new programming language CALPAS. A program in this language always takes one non-negative integer and re…
传送门:http://codeforces.com/contest/879/problem/C 本题是一个位运算问题——位运算的等价变换. 假设位运算符“&”“|”“^”是左结合的,且优先级相同,则一个表达式:“x@a[1]@a[2]@...@a[n]”,等价于“(...((x@a[1])@a[2])...)@a[n]”.其中,“@”为位运算符“&”“|”“^”. 将表达式“x@a[1]@a[2]@...@a[n]”表示为一个简单的等价形式:“((x&a)|b)^c”,即“x&am…
A. Borya's Diagnosis 传送门:http://codeforces.com/contest/879/problem/A 本题是一个模拟问题. 依次访问n个元素,第i个元素首次出现于si时刻,之后相邻两次出现的时间间隔为di.求访问结束的时刻. 贪心地模拟之. 注意事项:当运算符“/”用于负操作数时,在C89中,其结果由实现定义:在C99中,除法的结果总是向零截取的!! 注意特判si>cur的情形,以避免“由实现定义”的负操作数除法“/”. 参考程序如下: #include <…
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题.. 今天,我们来扒一下cf的题面! PS:本代码不是我原创 1. 必要的分析 1.1 页面的获取 一般情况CF的每一个 contest 是这样的: 对应的URL是:http://codeforces.com/contest/xxx 还有一个Complete problemset页面,它是这样的:…
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…
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's…
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…