正文
增加 9 行删除 9 行
40 行未改动4142434445464748495051525354555657585960616263646566677 行未改动7576777879808182833 行未改动8788899091929394957 行未改动1031041051061071081091101112 行未改动11411511611711811912012112240 行未改动int n;int p[N][N];int G[1<<N][1<<N],no[1<<N][1<<N];int g[1<<N][1<<N],f[1<<N][1<<N];int main(){freopen("magician.in","r",stdin);freopen("magician.out","w",stdout);ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);cin >> n;int inv=qmi(100,mod-2);for (int i=0;i<n;i++){for (int j=0;j<n;j++){cin >> p[i][j];pro(p[i][j],inv);}}for (int S=0;S<(1<<n);S++){for (int T=0;T<(1<<n);T++){7 行未改动no[S][T]=1;for (int x=0;x<n;x++) if (S>>x&1) for (int y=0;y<n;y++) if (T>>y&1) pro(no[S][T],Mod(1-p[x][y]));}}for (int S=0;S<(1<<n);S++){for (int T=0;T<(1<<n);T++){3 行未改动for (int s=S;;s=(s-1)&S){for (int t=T;;t=(t-1)&T){if (s || t)if (g[s][t] && no[s][T^t] && f[S^s][T^t])dec(f[S][T],(ll)g[s][t]*no[s][T^t]%mod*f[S^s][T^t]%mod);if (!t) break;}7 行未改动{for (int t=T;;t=(t-1)&T){if (s!=S || t!=T)if (popc(s)-popc(t)>=popc(S)-popc(T))if (g[s][t] && no[s][T^t] && f[S^s][T^t])dec(g[S][T],(ll)g[s][t]*no[s][T^t]%mod*f[S^s][T^t]%mod);if (!t) break;}2 行未改动}}}cout << f[(1<<n)-1][(1<<n)-1] << "\n";return 0;}```:::40 行未改动4142434445464748495051525354555657585960616263646566677 行未改动7576777879808182833 行未改动8788899091929394957 行未改动1031041051061071081091101112 行未改动11411511611711811912012112240 行未改动int n;int p[N][N];int G[1<<N][1<<N],no[1<<N][1<<N];int g[1<<N][1<<N],f[1<<N][1<<N];int main(){freopen("magician.in","r",stdin);freopen("magician.out","w",stdout);ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);cin >> n;int inv=qmi(100,mod-2);for (int i=0;i<n;i++){for (int j=0;j<n;j++){cin >> p[i][j];pro(p[i][j],inv);}}for (int S=0;S<(1<<n);S++){for (int T=0;T<(1<<n);T++){7 行未改动no[S][T]=1;for (int x=0;x<n;x++) if (S>>x&1) for (int y=0;y<n;y++) if (T>>y&1) pro(no[S][T],Mod(1-p[x][y]));}}for (int S=0;S<(1<<n);S++){for (int T=0;T<(1<<n);T++){3 行未改动for (int s=S;;s=(s-1)&S){for (int t=T;;t=(t-1)&T){if (s || t)if (g[s][t] && no[s][T^t] && f[S^s][T^t])dec(f[S][T],(ll)g[s][t]*no[s][T^t]%mod*f[S^s][T^t]%mod);if (!t) break;}7 行未改动{for (int t=T;;t=(t-1)&T){if (s!=S || t!=T)if (popc(s)-popc(t)>=popc(S)-popc(T))if (g[s][t] && no[s][T^t] && f[S^s][T^t])dec(g[S][T],(ll)g[s][t]*no[s][T^t]%mod*f[S^s][T^t]%mod);if (!t) break;}2 行未改动}}}cout << f[(1<<n)-1][(1<<n)-1] << "\n";return 0;}```:::