随笔分类 -  构造

摘要:Solutions A. Candies and Two Sisters 直接$\frac{x 1}2$ B. Construct the String 发现和字串长度无关,直接循环不同字符数即可。这样肯定是符合的。 阅读全文
posted @ 2020-04-19 23:35 Frontierone 阅读(201) 评论(0) 推荐(0)
摘要:Solutions A. Choose Two Numbers 题意: 给出$A,B$两个集合,$A,B$ 集合分别选一个数$a,b$ ,使得$a+b\notin\ A,B$ 思路: 每个集合选出最大值,必定满足条件。emmmmm比赛的时候傻了。 阅读全文
posted @ 2019-08-22 18:23 Frontierone 阅读(194) 评论(0) 推荐(0)
摘要:Contest Info "Contest Link" Solved| A | B | C | D | E | F | G | H | I | J | K : : | : : | : :| : :| : : | : :| : :| : :| : : | : : | : : | : : 2/12 |O 阅读全文
posted @ 2019-08-06 22:38 Frontierone 阅读(208) 评论(0) 推荐(0)
摘要:Solutions B:Crazy Binary String 题意: 给出$01$串,询问最长的“$01$数量相等”的字串和子序列。 思路: 字串的话,把$0$变成$-1$,求前缀和,如果$sum[r]-sum[l-1]=0$,说明$01$数量相等。 所以可以跑一遍,$map$找到符合的位置。取最 阅读全文
posted @ 2019-07-26 23:03 Frontierone 阅读(228) 评论(0) 推荐(0)
摘要:A:模拟,出现重复的break。 1 #include <bits/stdc++.h> 2 #define lowbit(x) (x)&(-x) 3 #define il inline 4 #define lson l,mid-1,now 5 #define rson mid+1,r,now 6 # 阅读全文
posted @ 2019-04-28 21:12 Frontierone 阅读(137) 评论(0) 推荐(0)
摘要:D. Vasya And The Matrix time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Now Vasya is tak 阅读全文
posted @ 2018-08-06 10:54 Frontierone 阅读(138) 评论(0) 推荐(0)