摘要: 线性基 #include<bits/stdc++.h> using namespace std; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define mid int m = (l + r) >> 1 const int M = 1e4+ 阅读全文
posted @ 2020-11-19 22:01 GUO_dx 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Read the following 4 Figures which show the results of a study. Fig. 1 presents the frequency of eating foods prepared away from home. Fig. 2 and Fig. 阅读全文
posted @ 2023-06-17 22:20 GUO_dx 阅读(15) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <algorithm> #include <cstring> #include <fstream> #include <string> #include <cstdio> #include <vector> #include <iterato 阅读全文
posted @ 2022-06-30 23:05 GUO_dx 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 内核引进了struct task_group结构,如下: /* 进程组,用于实现组调度 */ struct task_group { /* 用于进程找到其所属进程组结构 */ struct cgroup_subsys_state css; #ifdef CONFIG_FAIR_GROUP_SCHED 阅读全文
posted @ 2022-05-06 22:31 GUO_dx 阅读(245) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2022.cnblogs.com/blog/2144337/202204/2144337-20220419193151232-1315932471.png) ![](https://img2022.cnblogs.com/blog/2144337/202204/2144337-20220419193213763-2136825767.png) ![](https:// 阅读全文
posted @ 2022-04-19 20:20 GUO_dx 阅读(440) 评论(0) 推荐(0) 编辑
摘要: 分析: 一步步按照它的要求来就是了。 多项式除法的过程要手动模拟(有点像高精度)。 一开始我50分,是只对答案取了模没对过程取模。 然后80分,发现3^k其实会爆long long。 注意每一处的细节(要不要取模) 代码 #include <bits/stdc++.h> using namespac 阅读全文
posted @ 2022-03-27 09:16 GUO_dx 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 思路: 题目要求最多能送多少个外卖,不妨转换思路,求怎么在相同的送外卖情况下花最少的时间。 这种解法不仅便于设计程序,而且正确性显然:求出这个状态的最小时间,就越有可能转移到能取最优值的那个状态上面。 于是使用利于理解的记忆化dfs,记录当前点是哪个,各包裹的状态(0/1/2,0表示没动,1表示拿在 阅读全文
posted @ 2022-01-11 16:30 GUO_dx 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 求解形如Ax≡B(mod M)的最小正整数解。 il void exgcd(re ll A,re ll B,re ll &D,re ll &x,re ll &y) { if(!B) x=1,y=0,D=A; else exgcd(B,A%B,D,y,x,c),y-=(A/B)*x; } il voi 阅读全文
posted @ 2021-09-15 16:45 GUO_dx 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 分析:用数位dp的方法去做,记录好last是啥,然后前面是前导零的话后一位可以选择前导零,前面不是的话后一位不能是前导零。最后判断这个数合不合法。注意一开始lead和limit都是1 code: #include<iostream> #include<cstdio> #include<cmath> 阅读全文
posted @ 2021-09-12 17:18 GUO_dx 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 题意: 给n个字符串,和q个询问,每个询问给一个前缀和后缀,问你在这n个字符串中有多少个包含这一对前缀和后缀,前缀后缀不能重叠。 题解: 这题有一个巧妙的办法,用AC自动机去跑。 比如待匹配串是abc,abcd,那么我们将它们转换为abc{abc,abcd{abcd, 为什么用'{'呢, 阅读全文
posted @ 2021-08-11 11:40 GUO_dx 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 题目大意: 把一段长为n的序列分成k组(每组是连续的一段),然后玩家不停地操作: step 1: 找到第一个没被全灭的组 step 2: 把这个组里灭了的 t[i] 全加起来,然后把新的没被灭的 t[i+1]也加进去 step 3: 最后从Σt中随便选一个,删去它代表的位上的数。意思就是第i+1个数 阅读全文
posted @ 2021-08-10 20:43 GUO_dx 阅读(40) 评论(0) 推荐(0) 编辑