Codeforces Round #645 (Div. 2)】的更多相关文章

A.Accurate Movement(复现赛) 题意:两个木块最左边都在0的位置,最右边分别为a,b(b>a),并且短的木条只能在长木条内移动,问两个木条需要移动多少次才能使两个木条的右端都在n 思路:短木条最少移动(n-a)/(b-a),如果(n-a)%(b-a)不为0,那么还需要再多移动一次,才能到达最右边,长木条以此类推 代码: 1 #include<iostream> 2 #include<algorithm> 3 #include<cmath> 4 #…
题目链接:The Best Vacation 题意: 给你n个月份,每一个月份有di天.你可以呆在那里x天(x天要连续),如果你在某月的第y天呆在这.那么你的拥抱值就加y 1<=n<=2e5 1<=di<=1e6 题解: 首先这段日期的结尾一定是月末.下面证明 如果x<=max(d1,d2...dn) 那么肯定是在那个max(d1,d2...dn)那个月最后x天呆在那得到的拥抱值最大 如果选取的这段日期至少覆盖到两个月份.如果右端点不是月末的话,假设左端点对应的日期大于右端点…
题目链接:C.Celex Update 题意: 给你如图所示的图形,问从(x1,y1)−>(x2,y2)路径上的不同的元素和的数量是多少. 题解: 从(1,1)到(3,3) 元素和的1−2−4−8−13是这些元素和中最小的一个,然后1−2−5−8−13和之前的一个相比多了1,在2处增加一个的话,那么就是1−3−5−8−13这就是增加了两个的了,最后我们可以发现从最小的元素和到最大的元素中全部的都会出现,那么就是计算中间的差值 这几个块,每多用一个,就比之前的多加1 代码: #include<s…
题意:一年有\(n\)个月,每月有\(d_{i}\)天,找出连续的\(x\)天,使得这\(x\)天的日期总和最大,任意一年都能选. 题解:首先要先贪心,得到:连续的\(x\)天的最后一天一定是某个月的最后一天,我们先预处理两个前缀和,分别记录连续的天数和总日期数,然后枚举,二分找出一个区间,得出这个区间的总日期数再加上区间最左边的剩余的\(x\)的总日期,每次维护一个最大值即可.(记得开\(long\ long\)) 代码: #include <iostream> #include <c…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…
 cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....       其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/output 1 s, 256 MB  x2377 B Queue standard input/output 2 s, 256 MB  x1250 C Hacking Cypher standard input/output 1 s, 256 MB  x740 D Chocolate standard in…
Codeforces Round #262 (Div. 2) 1003 C. Present time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little beaver is a beginner programmer, so informatics is his favorite subject. Soon his info…