結果
| 問題 |
No.2911 位相の公理
|
| コンテスト | |
| ユーザー |
たたき@競プロ
|
| 提出日時 | 2024-10-19 00:02:06 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 2,000 ms |
| コード長 | 849 bytes |
| コンパイル時間 | 5,231 ms |
| コンパイル使用メモリ | 309,788 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-19 00:02:14 |
| 合計ジャッジ時間 | 6,752 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#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){
sr s;cin>>s;
int a=0;
rep(j,n)if(s[n-j-1]=='1')a^=1<<j;
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";
}
たたき@競プロ