写线段树的时候,每次都又要打括号又要打点,不厌其烦
于是我灵机一动,把所有可能要用的都提前宏定义一下,这样只需要打字母不需要打标点符号,让我打字起来顺畅了许多
define tpl t[p].l
define tpr t[p].r
define tps t[p].sum
define tpml t[p].ml
define tpmr t[p].mr
define tpa t[p].ans
define t2pl t[p*2].l
define t2pr t[p*2].r
define t2ps t[p*2].sum
define t2pml t[p*2].ml
define t2pmr t[p*2].mr
define t2pa t[p*2].ans
define t2p1l t[p*2+1].l
define t2p1r t[p*2+1].r
define t2p1s t[p*2+1].sum
define t2p1ml t[p*2+1].ml
define t2p1mr t[p*2+1].mr
define t2p1a t[p*2+1].ans
define mid (l+r)/2
define middle (t[p].l+t[p].r)/2
(因为打太多井号会导致洛谷判定滥用标题行,所以我把井号删了)
但是我也有一个疑惑,就是这样写宏定义会不会导致程序跑起来变慢导致被卡常?有没有大佬能解释一下这个问题?