2023年11月15日
摘要: P9752 [CSP-S 2023] 密码锁 直接模拟统计就可以了,看每个状态有多少个转移的状态,就是输入的所有状态里面,把所以可能是由此转化来的++,最后循环所有的情况,如果能够转移的数量为n,那么就是结果++ #include <bits/stdc++.h> typedef long long 阅读全文
posted @ 2023-11-15 23:57 shirlybabyyy 阅读(53) 评论(0) 推荐(0) 编辑
2023年11月12日
摘要: P5661 [CSP-J 2019] 公交换乘 就是模拟,注意车票还有使用时间限制,所以在记录坐地铁的时候就要设置时限,如果坐公交车的时间过了所有优惠票那就不能坐,而且也要记录最左边可以用的车票位置 #include<iostream> #include<cstdio> #include<cstri 阅读全文
posted @ 2023-11-12 23:00 shirlybabyyy 阅读(3) 评论(0) 推荐(0) 编辑
2023年11月9日
摘要: [CSP-J 2023] 小苹果 模拟分组,第n个什么时候取到,就是什么时候处在分组第一个 #include<bits/stdc++.h> using namespace std; int n,ans,k; int main(){ cin>>n; while(n){ ans++; if(k==0&& 阅读全文
posted @ 2023-11-09 20:19 shirlybabyyy 阅读(33) 评论(0) 推荐(0) 编辑
2023年11月1日
摘要: 【20CSPJ普及组】优秀的拆分 直接用二进制处理,不断对2取余,除2,如果奇数,那肯定就是不行的 #include<bits/stdc++.h> using namespace std; const int maxn=10100; const int INF=0x3fffffff; typedef 阅读全文
posted @ 2023-11-01 17:49 shirlybabyyy 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 其实哪里需要模拟啊!!!这么简单的问题!!!是头猪也想得到 #include <bits/stdc++.h> using namespace std; const int maxn=505; int main() { int n,l,r; cin>>n>>l>>r; if(l/n==r/n) cou 阅读全文
posted @ 2023-11-01 16:14 shirlybabyyy 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 直接模拟即可,注意特判 #include<iostream> #include<cstdio> #include<ctime> #include<cstdlib> #include<cmath> #include<cstring> #include<algorithm> #define maxn 2 阅读全文
posted @ 2023-11-01 14:32 shirlybabyyy 阅读(3) 评论(0) 推荐(0) 编辑
2023年10月31日
摘要: https://www.luogu.com.cn/problem/P3871 看题解有好几种做法 1、对顶堆:用两个堆,分别是大顶堆和小顶堆,维护一个动态的有序序列 我们首先将所有的数丢进大根堆里然后取一半丢进小根堆里,这样就把所有的数分成了两段有序的部分。 加入操作可以每次取小根堆堆顶和加入的数比 阅读全文
posted @ 2023-10-31 17:03 shirlybabyyy 阅读(3) 评论(0) 推荐(0) 编辑
2023年10月16日
摘要: 习题都来自董老师的博客和b站: 这些题目都是优点变形的,不是模版题,需要找到正确使用线段树进行区间维护的方法,再加上一些其他的思想,比如差分、前缀和等,进行区间修改和点修改的转化,修改的时候也可能有不同的情况,比如开方、加上等差数列、sincos的加减等等 涉及到的算法:排序、双指针、贪心、二分、数 阅读全文
posted @ 2023-10-16 18:11 shirlybabyyy 阅读(2) 评论(0) 推荐(0) 编辑
2023年10月5日
摘要: https://www.bilibili.com/video/BV1Aa411Q7qp/?spm_id_from=333.999.0.0&vd_source=23dc8e19d485a6ac47f03f6520fb15c2 董老师讲的很清楚 https://www.luogu.com.cn/prob 阅读全文
posted @ 2023-10-05 17:47 shirlybabyyy 阅读(6) 评论(0) 推荐(0) 编辑
2023年6月14日
摘要: 后缀树和后缀数组 讲解: https://www.cnblogs.com/shanchuan04/p/5324009.html https://blog.csdn.net/yxuanwkeith/article/details/50636898 上面两个参考一下 https://www.bilibi 阅读全文
posted @ 2023-06-14 13:41 shirlybabyyy 阅读(8) 评论(0) 推荐(0) 编辑