版本比较
题解:P12375 「LAOI-12」MST?
正文
增加 2 行删除 2 行
35 行未改动36373839404041424343444535 行未改动 if (m < mid * (mid - 1) / 2 + (n - mid)) R = mid - 1; else L = mid + 1; } LL x = L; i128 ans = i128(x * x - x * 2 + 6) * (x - 1) / 6 + i128(n - x) * (m * 2 - n + x + 1) / 2; i128 ans = i128(x * x - x * 2 + 6) * (x - 1) / 6 + i128(n - x) * (m * 2 - n + x + 1) / 2; cout << int(ans % 998244353) << '\n'; } return 0; return 0;}```