随笔分类 -  基本算法-构造

摘要:给你一个长度为 $\left|s\right|$ 的01串 $s$ ,每次操作你可以任选一个 $k$ ,使01串的 $[1,k]$ 和 $(k,\left|s\right|]$ 分别翻转(其中一个区间可以为空),求经过任意次操作后能得到的最长的01交替出现的子串的长度。(实际题目中01用w和b代替) 阅读全文
posted @ 2018-08-24 03:13 Roni_i 阅读(250) 评论(0) 推荐(0) 编辑
摘要:``` You are given three integers a, b and x. Your task is to construct a binary string s of length n=a+b such that there are exactly a zeroes, exactly 阅读全文
posted @ 2018-07-21 22:42 Roni_i 阅读(247) 评论(0) 推荐(0) 编辑
摘要:链接:https://www.nowcoder.com/acm/contest/93/F来源:牛客网 题目描述 你们wyh学长给你n个点,让你分成2个集合,然后让你将这n个点进行两两连接在一起,连接规则是这样的 1. 连接的两个点必须在不同的两个集合 2. 一个集合内部任意两个点之间不能相连 现在, 阅读全文
posted @ 2018-04-05 23:29 Roni_i 阅读(310) 评论(0) 推荐(0) 编辑
摘要:1997: Seating Arrangement Description Mr. Teacher老师班上一共有n个同学,编号为1到n。 在上课的时候Mr. Teacher要求同学们从左至右按1, 2, …, n的顺序坐成一排,这样每个同学的位置是固定的,谁没来上课就一目了然了。 但是时间长了之后, 阅读全文
posted @ 2018-04-04 19:38 Roni_i 阅读(264) 评论(0) 推荐(0) 编辑
摘要:B. Soldier and Badges time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output B. Soldier and Bad 阅读全文
posted @ 2017-12-06 15:28 Roni_i 阅读(302) 评论(0) 推荐(0) 编辑
摘要:题目背景(https://www.luogu.org/problemnew/show/P3742) umi 找到了一个神秘的函数 f。 题目描述 这个函数接受两个字符串 s1,s2。这些字符串只能由小写字母组成,并且具有相同的长度。这个函数的输出是另一个长度与 s1,s2 相同的字符串 g。g 的第 阅读全文
posted @ 2017-12-03 23:19 Roni_i 阅读(277) 评论(0) 推荐(0) 编辑
摘要:C. Marco and GCD Sequence time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Marco and GC 阅读全文
posted @ 2017-11-20 15:40 Roni_i 阅读(273) 评论(0) 推荐(0) 编辑
摘要:A. Mahmoud and Ehab and the MEX time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Mahmo 阅读全文
posted @ 2017-09-21 17:33 Roni_i 阅读(387) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示