QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#757894 | #5089. 环覆盖 | acwing_gza | 0 | 0ms | 0kb | C++14 | 734b | 2024-11-17 14:24:40 | 2024-11-17 14:24:41 |
answer
#include<bits/stdc++.h>
using namespace std;
#define fo(i,a,b) for(int i=a;i<=b;i++)
const int N=25,mod=1e9+7;
int n,m,inv=1,u,v;
ifstream I("even.in");
int dp[1<<N],s[N*N]={1},f[N*N]={1},t[N*N],g[N];
signed main(){
freopen("even.out","w",stdout);
I>>n>>m;
fo(i,1,m)I>>u>>v,u--,v--,g[u]|=1<<v,g[v]|=1<<u;
fo(i,1,n)inv=inv&1?inv+mod>>1:inv>>1;
fo(i,1,(1<<n)-1){
int k=__lg(i&-i);
dp[i]=dp[i&i-1]+__builtin_popcount(g[k]&(1<<n)-i-1)-__builtin_popcount(g[k]&i),s[dp[i]]++;
}
fo(i,1,m)for(int j=m;j;j--)(f[j]+=f[j-1])%=mod;
fo(i,0,m){
fo(j,0,m)(t[j]+=1ll*s[i]*f[j]%mod)%=mod;
fo(j,1,m)(f[j]+=mod-f[j-1])%=mod;
for(int j=m;j;j--)(f[j]+=mod-f[j-1])%=mod;
}
fo(i,0,m) cout<<1ll*t[i]*inv%mod<<' ';
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Dangerous Syscalls
Test #1:
score: 0
Dangerous Syscalls
input:
10 9 3 5 3 10 4 7 4 8 5 6 5 9 6 9 7 9 9 10
output:
result:
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Dangerous Syscalls
Test #31:
score: 0
Dangerous Syscalls
input:
25 45 1 6 1 12 1 17 2 3 2 4 2 6 3 6 3 8 4 5 4 12 4 16 5 17 6 21 7 14 7 22 7 23 8 15 8 19 8 24 9 11 9 19 9 23 9 25 10 17 10 18 11 16 11 19 11 22 12 19 13 18 14 19 15 19 16 24 17 19 17 22 17 25 18 19 18 21 18 24 19 23 20 22 21 25 22 23 23 25 24 25
output:
result:
Subtask #4:
score: 0
Skipped
Dependency #2:
0%
Subtask #5:
score: 0
Skipped
Dependency #4:
0%