摘要:
"题目描述" 思路 Treap 模板题 代码 c++ include include include const int MAX = 110000 + 5; int n, m, rt, tot, inf = 0x7f3f3f3f, ot; char str[100]; struct Node { i 阅读全文
摘要:
"题目描述" 思路 代码 c++ include include include include const int MAX = 8e4 + 5, mod = 1e6; int n, m, inf = 0x3f3f3f3f; int ans, rt, tot; bool flag; struct N 阅读全文
摘要:
"题目描述" 思路 代码 c++ include include include include define min(a, b) ((a) = 2) cnt(r) , size(r) ; else if (!lc(r) || !rc(r)) r = lc(r) + rc(r); else if ( 阅读全文
摘要:
``` 和$(ls /etc) 是两种获取命令执行结果的方式。 for file in List 的语法里面的List 就是使用使用ls /etc 的命令执行结果作为List(https://www.shiyanlou.com/questions/59195/) shell !/bin/bash f 阅读全文
摘要:
"题目描述" 思路 尽量不要直接使用getchar得到单个字符,容易出现runtime error, 可以使用scanf("%s", str), 直接判断str[0]是否是对应字符就可以了。 代码 c++ include include define lc k '9') { if (ch == ' 阅读全文
摘要:
"题目描述" 思路 使用两个标记sum, flag(fg), sum表示安装软件的子节点有多少个;flag表示对这个区间的软件进行操作,1 全部安装, 1全部卸载,0不进行操作 代码 c++ include include define lc k '9') { if (ch == ' ') f = 阅读全文
摘要:
"题目描述" 思路 树链剖分更新子树x,由于线段树节点的顺序由dfs产生,所以更新的线段树区间为[dfn[x], dfn[x] + size[x] 1] 代码 c++ include include define lc k '9') { if (ch == ' ') f = 1; ch = getc 阅读全文