版本比较
LCA
正文
增加 1 行删除 1 行
31 行未改动32333435363738394070 行未改动31 行未改动if(f[x][i] != f[y][i]) x = f[x][i], y = f[y][i];return f[x][0];}int main(){ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);cin >> n >> m >> s;t = (int)(log(n) / log(2)) + 1;//最大深度70 行未改动31 行未改动32333435363738394070 行未改动31 行未改动if(f[x][i] != f[y][i]) x = f[x][i], y = f[y][i];return f[x][0];}int main(){ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);cin >> n >> m >> s;t = (int)(log(n) / log(2)) + 1;//最大深度70 行未改动