版本比较
CCH(?) MX-S8 总结
正文
增加 15 行删除 15 行
197 行未改动全部展开198199200201202202203204205206286 行未改动全部展开493494495496497497498499500501160 行未改动全部展开66266366466566666666766866866967067167237 行未改动7107117127137147147157167177187197207207217227237247247257267277287297307307317327337342 行未改动73773873974074174174274374474513 行未改动7597607617627637637647657657667677687692 行未改动7727737747757767767777787797807817817827837847857 行未改动793794795796797797798799800801802802803804805806135 行未改动全部展开197 行未改动全部展开
梦熊出题人德才兼亡。
:::info[没有可读性的赛时代码]
```cpp#include <bits/stdc++.h>#define ll long longusing namespace std;286 行未改动全部展开 if (ans[x][y] == INF) cout << "No\n"; else cout << ans[x][y] << "\n"; }}} }namespace SDSAF {void solve() { for (int i = 1; i <= n; i++) fu[i] = i; for (int i = 0; i < m; i++) {160 行未改动全部展开
// 修正的lg函数inline int lg(i128 x) { if (x == 0) return -1; if (x >> 64) if (x >> 64) return 127 - __builtin_clzll((ull)(x >> 64)); else else return 63 - __builtin_clzll((ull)x);}
struct cmp {37 行未改动 do { id[V] = p.size(); p.emplace_back(V); } while (next_permutation(V.begin(), V.end()));
for (int i = 0; i < 120; i++) { for (int j = 0; j < 120; j++) { S[i][j] = id[p[i] * p[j]]; } }
int cnt = 0; pq.emplace(one); // 使用one而不是1 vis[one] = 1;
while (!pq.empty()) { i128 x = pq.top(); pq.pop(); int o = cnt++; H[st[o] = x] = o; D[o] = popc(x);
for (int i = 0; i < 120; i++) { if (!(x >> i & 1)) { i128 y = E(x | (one << i)); // 使用one if (!vis[y]) {2 行未改动 } } } }
for (int i = 0; i < cnt; i++) { for (int j = 0; j < 120; j++) { k[i][j] = H[E(st[i] | (one << j))]; // 使用one }13 行未改动
int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
init();
cin >> n >> m >> q; vi C(5); for (int i = 0; i < m; i++) { int u, v; cin >> u >> v; u--; v--;2 行未改动 } int w = id[C]; e[i] = node(u, v, w); }
for (int i = 0; i < q; i++) { cin >> Q[i].first >> Q[i].second; --Q[i].first; --Q[i].second; }
for (int o = 0; o < 156; o++) { for (int i = 0; i < n; i++) { f[i] = i; s[i] = 1; }7 行未改动 ans[i] = D[o]; } } }
for (int i = 0; i < q; i++) { if (ans[i]) cout << ans[i] << "\n"; else cout << "No\n"; }
return 0;}```
135 行未改动全部展开