結果
問題 |
No.2911 位相の公理
|
ユーザー |
![]() |
提出日時 | 2024-10-18 23:15:24 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 799 bytes |
コンパイル時間 | 5,574 ms |
コンパイル使用メモリ | 310,040 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-18 23:15:35 |
合計ジャッジ時間 | 6,951 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 WA * 5 RE * 7 |
ソースコード
#include<bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using mint=modint998244353; //1000000007; using ll=long long; using pp=pair<int,int>; #define sr string #define vc vector #define fi first #define se second #define rep(i,n) for(int i=0;i<(int)n;i++) #define pb push_back #define all(v) v.begin(),v.end() #define pque priority_queue #define bpc(a) __builtin_popcount(a) int main(){ int n,m;cin>>n>>m; bool ans=true; int b=1<<n; vc<bool>v(b,0); vc<int>x; rep(i,m){ int a;cin>>a; v[a]=1; x.pb(a); } if(!v.back())ans=0; rep(i,m)rep(j,i)if(!v[x[i]&x[j]])ans=0; vc<int>g(b,0); rep(i,b)if(v[i])g[i]=i; rep(i,n)rep(j,b)if(~j>>i&1)g[j^1<<i]|=g[j]; rep(i,b)if(g[i]==i&&!v[i])ans=0; if(ans)cout<<"Yes"; else cout<<"No"; }