正文
增加 15 行删除 15 行
197 行未改动全部展开198199200201202203204205206286 行未改动全部展开493494495496497498499500501160 行未改动全部展开66266366466566666766866967067167237 行未改动7107117127137147157167177187197207217227237247257267277287297307317327337342 行未改动73773873974074174274374474513 行未改动7597607617627637647657667677687692 行未改动7727737747757767777787797807817827837847857 行未改动793794795796797798799800801802803804805806135 行未改动全部展开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)return 127 - __builtin_clzll((ull)(x >> 64));elsereturn 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而不是1vis[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)); // 使用oneif (!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 行未改动全部展开197 行未改动全部展开198199200201202203204205206286 行未改动全部展开493494495496497498499500501160 行未改动全部展开66266366466566666766866967067167237 行未改动7107117127137147157167177187197207217227237247257267277287297307317327337342 行未改动73773873974074174274374474513 行未改动7597607617627637647657667677687692 行未改动7727737747757767777787797807817827837847857 行未改动793794795796797798799800801802803804805806135 行未改动全部展开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)return 127 - __builtin_clzll((ull)(x >> 64));elsereturn 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而不是1vis[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)); // 使用oneif (!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 行未改动全部展开