版本比较
题解:P15801 [GESP202603 六级] 完全二叉树
正文
增加 5 行删除 5 行
60 行未改动61626364656566676768697071727273747576777778798081828384848586878824 行未改动60 行未改动 return; } if (t[u].l) dfs(t[u].l); if (t[u].r) dfs(t[u].r);
dep[u] = max(dep[t[u].l], dep[t[u].r]) + 1;
if (tp[t[u].l] == 3 || tp[t[u].r] == 3 || dep[t[u].l] > dep[t[u].r] + 1) { tp[u] = 3; return; }
if (dep[t[u].l] < dep[t[u].r]) { tp[u] = 3; return; }
if (dep[t[u].l] == dep[t[u].r]) { if (tp[t[u].l] == 1 && tp[t[u].r] == 1) tp[u] = 1; else if (tp[t[u].l] == 1 && tp[t[u].r] == 2) tp[u] = 2; else tp[u] = 3; return; }
if (dep[t[u].l] == dep[t[u].r] + 1) { if (tp[t[u].r] == 1) tp[u] = 2; else tp[u] = 3; return;24 行未改动