CodeForces 569A 第八次比赛 C题】的更多相关文章

Description Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his favorite songs in a well-known social network InTalk. Unfortunately, internet is not that fast in the city of E…
Description n participants of the competition were split into m teams in some manner so that each team has at least one participant. After the competition each pair of participants from the same team became friends. Your task is to write a program th…
C - C Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 569A Description Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha lis…
Description You probably have played the game "Throwing Balls into the Basket". It is a simple game. You have to throw a ball into a basket from a certain distance. One day we (the AIUB ACMMER) were playing the game. But it was slightly differen…
B - B Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u   Description n participants of the competition were split into m teams in some manner so that each team has at least one participant. After the competition each pair…
codeforces  569A   Music   解题报告 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88890#problem/C 题目: Description Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his…
金色十月线上编程比赛第二题:解密 题目详情: 小强是一名学生, 同一时候他也是一个黑客. 考试结束后不久.他吃惊的发现自己的高等数学科目竟然挂了,于是他果断入侵了学校教务部站点. 在入侵的过程中.他发现了与成绩相关的内容是一个加密文件,这个文件由 n 个数构成,经过分析.这个加密文件的密钥为这 n 个数中二进制位数 1 最少的数. 但因为数比較多,小强 希望你能帮他得到密钥,好在成绩发布之前将成绩改过来. 输入描写叙述: 输入由多组数据构成.每组数据第一行为一个数 n(1<=n<=10^5),…
Codeforces Round #609 (Div. 2)前五题题解 补题补题…… C题写挂了好几个次,最后一题看了好久题解才懂……我太迟钝了…… 然后因为longlong调了半个小时…… A.Equation 题目大意:有一个数字n,让你给出任意两个合数a,b满足a - b = n. 我们知道大于2的偶数都是合数,那么如果n为奇数,只要n加上一个奇数合数一定也为合数,如果n为偶数,那么n加上一个偶数合数也一定为合数. 因为只求任意一组,就直接选择4,9,若为奇数输出 +n 和9,偶数输出 +…
题目链接: A. Music time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to hi…
Codeforces 1082B Vova and Trophies https://vjudge.net/problem/CodeForces-1082B 题目: Vova has won nn trophies in different competitions. Each trophy is either golden or silver. The trophies are arranged in a row. The beauty of the arrangement is the le…
B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the current time in 24-hour format hh:mm. Find and print the time after a minutes. Note that you should find only the time after a minutes, see the examples t…
A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the infinite sequence of integers: 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5.... The sequence is built in the following way: at first the number 1 is wr…
A. Extract Numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/problem/A Description You are given string s. Let's call word any largest sequence of consecutive symbols without symbols ',' (comma) and ';' (semicolon…
A. Divisibility Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/problem/A Description Find the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x tha…
A. Towers 题目连接: http://www.codeforces.com/contest/37/problem/A Description Little Vasya has received a young builder's kit. The kit consists of several wooden bars, the lengths of all of them are known. The bars can be put one on the top of the other…
C. Tic-tac-toe 题目连接: http://www.codeforces.com/contest/3/problem/C Description Certainly, everyone is familiar with tic-tac-toe game. The rules are very simple indeed. Two players take turns marking the cells in a 3 × 3 grid (one player always draws…
Ballot Analyzing Device 题目连接: http://codeforces.com/gym/100269/attachments Description Election committee of Flatland is preparing for presidential elections. To minimize human factor in ballot counting they decided to develop an automated Ballot Ana…
Problem A. Arrangement of Contest 题目连接: http://codeforces.com/gym/100269/attachments Description Little Dmitry and little Petr want to arrange a contest. Their little friends submitted several task proposals and now Dmitry and Petr want to select som…
司老大当时教了一种姿势枚举连续K个0,说实话当时比赛写这题完全蒙了 纵然后来知道思路还是写了一段时间 真的是.. 题目大意 n长度的序列,由0 1构成 我们可以改变 k个0为1 求可以得到的最长连续1序列的长度 既然求连续1 我们贪心连续k个0 枚举端点 左端点0设置为0 右端点0设置为 n+1 中间统计一下 最长长度和改变的0的位置就OK了 #include<cstdio> #include<map> //#include<bits/stdc++.h> #includ…
6月快要结束了 期末也过去大半了 马上就是大三狗了 取消了小学期后20周的学期真心长, 看着各种北方的学校都放假嗨皮了,我们这个在北回归线的学校,还在忍受酷暑. 过年的时候下定决心要拿块ACM的牌子,一直坚持刷题,这一个学期刷了200道吧,感觉还是小有收获.特别是Ural和Codeforces上的题,质量很高. 然后4月的校赛,5月的省赛,发挥的也一般,不过也没有太失常. 希望暑假的选拔赛能碰到有趣的队友 蛤蛤. 这两天各种考试,实在是太忙,看了一下edu24的题目,不是很容易,做了一道水题,以…
比赛情况 bq. A题 Wrong Answer on test 2 , E题sb题没切.bqbqbq. 比赛总结 bq. 那就直接上题解吧!^-^ A 数位dp,分类讨论,注意细节. Talk is cheap.Show me the code. #include<bits/stdc++.h> using namespace std; inline int read() { int x=0,f=1; char ch=getchar(); while(ch<'0' || ch>'9…
比赛情况 2h才刀了A,B,C,D.E题的套路做的少,不过ygt大佬给我讲完思路后赛后2min就AC了这题. 比赛总结 比赛时不用担心"时间短,要做多快",这样会匆匆忙忙,反而会做得慢.比赛时应该要不紧不慢,理性思考,内心平静,题目反而会迎刃而解. 这次比赛又看错了题(B,D). 解决办法:这次比赛看错题是因为不够细心,不够细心是因为急躁,怕做不完.所以沉稳冷静的分析,反而能更好地完成比赛. 那么就开始上题解吧! A cf常出的分类讨论题(OI好像不考?). 如果三个人的位置互不相同,…
Codeforces 题面传送门 & 洛谷题面传送门 首先注意到这个图的特殊性:我们对于所有 \(s_i=s_j\)​ 的 \((i,j)\)​ 之间都连了条边,而字符集大小顶多只有 \(8\)​,因此当 \(n\)​ 比较大时这张图肯定是相当稠密的,故我们猜测这个直径长度肯定也不会太长.事实的确如此,具体来说,对于图上任意两个点 \(i,j\)​,它们之间最短距离的长度肯定不会超过 \(15\)​,具体证明大概就对于每一对字母 \((x,y)\)​,如果存在某两个位置 \(i,i+1\) 满足…
Codeforces 题目传送门 & 洛谷题目传送门 首先直接暴力枚举显然是不现实的,我们不妨换个角度来处理这个问题,考虑这 \(R_i\) 个瓶子中每一瓶被哪些熊在哪一天喝过. 我们考虑对这 \(R_i\) 个瓶子各建立一个 \(q\times n\) 的 01 矩阵,第 \(j\) 行第 \(k\) 列为 \(1\) 表示第 \(k\) 只熊在第 \(j\) 天尝过了这瓶酒,反之第 \(k\) 只熊在第 \(j\) 天尝过了这瓶酒. 那么题目中的条件可表示为: 每一个表格里 \(1\) 的个…
Codeforces 题目传送门 & 洛谷题目传送门 下设 \(n,m\) 同阶. 首先有一个傻子都会的暴力做法,枚举矩形的上.下边界 \(l,r\),考虑集合多重集 \(S=\{y|x\in[l,r],(x,y)\text{为标记点}\}\),也就是所有在第 \(l\) 行与第 \(r\) 行之间所有标记点的列坐标的集合,考虑进一步枚举矩形的左端点 \(x\),那么对于右端点 \(y\),以 \((l,x)\) 为左上角,\((r,y)\) 为右下角的矩形中至少有 \(k\) 个标记点当前仅当…
Codeforces 题目传送门 & 洛谷题目传送门 obviously,难度高一点的构造题对我来说都是不可做题 首先考虑将排列拆成一个个置换环,也就是 \(\forall i\) 连边 \(i\to p_i\),显然这样我们可以得到一个个环. 首先考虑怎样同时处理两个置换环,假设有两个环,长度分别为 \(p,q\),元素分别为 \(x_1,x_2,\cdots,x_p;y_1,y_2,\cdots,y_q\).我们考虑以下步骤同时将这两个环中所有元素复位: 交换 \(x_1,y_1\),两个置…
A 题 Vasily the Bear and Triangle 题目大意 一个等腰直角三角形 ABC,角 ACB 是直角,AC=BC,点 C 在原点,让确定 A 和 B 的坐标,使得三角形包含一个矩形,这个矩形一个角在原点,另一个点在 (x, y) 处,并且三角形 ABC 的面积尽量小 将 A B 两点按照 x 坐标从小到大输出 做法分析 A B 两点必然在坐标轴上,且线段 AB 经过点 (x, y),那么简单分类讨论下就行了 交之前犹豫了一下,10分钟才提交... 参考代码 #include…
Description After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the shape of a rectangle in his backyard. He has set up coordinate axes, and he wants the sides of the rectangle to be parallel to them. Of course, the a…
Description  meter long road between his house and the first shop and a d2 meter long road between his house and the second shop. Also, there is a road of length d3 directly connecting these two shops to each other. Help Patrick calculate the minimum…
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/B Description Kevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maximum point values of 500, 1000, 1500,…