1 条题解

  • 0
    @ 2026-6-29 17:43:25

    #include<bits/stdc++.h> using namespace std; int n,t,s=0,tj[30]; struct pl{ int x,y; }; pl a[220]; int main() { cin>>n>>t; for(int i=1;i<=t;i++) cin>>a[i].x>>a[i].y; for(int i=1;i<=(1<<n)-1;i++){ for(int j=0;j<n;j++){ if((i>>j)&1) tj[j+1]+=1; } int flag=1; for(int j=1;j<=t;j++){ if(tj[a[j].x]==1 && tj[a[j].y]1){ flag=0; break; } } if(flag1) s+=1; for(int j=1;j<=n;j++) tj[j]=0; } cout<<s<<endl; return 0; }

    • 1

    信息

    ID
    5266
    时间
    1000ms
    内存
    128MiB
    难度
    3
    标签
    递交数
    7
    已通过
    5
    上传者