上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 57 下一页
摘要: "传送门" 题意: 先有两种操作,插入和查询,插入操作则插入一个点$(x,y,z)$,查询操作给出两个点$(x_1,y_1,z_1),(x_2,y_2,z_2)$,回答满足$x_1\leq x\leq x_2,y_1\leq y\leq y_2,z_1\leq z\leq z_2$的$(x,y,z) 阅读全文
posted @ 2019-09-10 21:21 heyuhhh 阅读(211) 评论(0) 推荐(0) 编辑
摘要: "传送门" 题意: 求最小的$x$,满足$\frac{x(x+1)}{2}\% n=0,n\leq 10^{12}$。 多组数据,$T\leq 100$。 思路: 直接考虑模运算似乎涉及到二次剩余什么的,但比较复杂。 注意到比较特殊的就是,最后结果为$0$,那么我们就考虑将问题转化为整除。 所以式子 阅读全文
posted @ 2019-09-10 21:12 heyuhhh 阅读(275) 评论(0) 推荐(0) 编辑
摘要: "传送门" A abc 题意: 给出字符串$s$,要求统计$s$中子序列为$"abc"$的个数。 思路: 分别统计一下前缀$a$和后缀$c$的个数即可。 Code cpp include using namespace std; typedef long long ll; const int MOD 阅读全文
posted @ 2019-09-10 20:54 heyuhhh 阅读(195) 评论(0) 推荐(0) 编辑
摘要: "传送门" 思路: 就是cdq套cdq的模板题 cpp include using namespace std; typedef long long ll; const int N = 100005; struct node { int d1, d2, d3, d4, part; }a[N], b[ 阅读全文
posted @ 2019-09-09 19:18 heyuhhh 阅读(198) 评论(0) 推荐(0) 编辑
摘要: "传送门" A Password 输出$n n n$即可。 Code cpp include using namespace std; typedef long long ll; const int N = 25; int n; int a[N], b[N], c[N]; int main() { 阅读全文
posted @ 2019-09-09 14:42 heyuhhh 阅读(481) 评论(0) 推荐(1) 编辑
摘要: "传送门" 题意: 给出一个长度为$n$的串,现在有$q$个询问,每个询问是一个区间$[l,r]$,要回答在区间$[l,r]$中,最少需要删多少个数,满足区间中包含$2017$的子序列而不包含$2016$的子序列。 思路: 先不考虑多个询问,那么这个问题区间$dp$可以解决,状态定义中要附加状态转移 阅读全文
posted @ 2019-09-09 13:55 heyuhhh 阅读(267) 评论(0) 推荐(1) 编辑
摘要: "传送门" A. Enju With math problem 题意: 给出$a_1,\cdots,a_{100}$,满足$a_i\leq 1.5 10^8$。 现在问是否存在一个$pos$,满足: $$ \forall x\in [1,100],a_x=\varphi(x+pos 1) $$ 思路 阅读全文
posted @ 2019-09-09 12:56 heyuhhh 阅读(397) 评论(0) 推荐(0) 编辑
摘要: "传送门" A. Creating a Character 暴力枚举显然不行,推一下式子就出来了,注意一下边界条件。 Code cpp include define INF 0x3f3f3f3f using namespace std; typedef long long ll; const int 阅读全文
posted @ 2019-09-07 10:53 heyuhhh 阅读(285) 评论(0) 推荐(0) 编辑
摘要: "传送门" A. Optimal Currency Exchange 枚举一下就行了。 Code cpp include using namespace std; typedef long long ll; int b, g, n; int main() { ios::sync_with_stdio 阅读全文
posted @ 2019-09-05 15:40 heyuhhh 阅读(299) 评论(0) 推荐(0) 编辑
摘要: "传送门" C Triangular Relationship 题意: 给出$n,k$,现在要你求合法三元组的数量,合法是指对于一个三元组$(a,b,c)$,每个数都不超过$n$,并且$a+b,b+c,a+c$为$k$的倍数。 思路: 按照模$k$的余数来讨论即可。 Code cpp include 阅读全文
posted @ 2019-09-04 22:15 heyuhhh 阅读(241) 评论(0) 推荐(1) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 57 下一页