結果
| 問題 |
No.2911 位相の公理
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-04 21:59:43 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,236 ms / 2,000 ms |
| コード長 | 666 bytes |
| コンパイル時間 | 7,190 ms |
| コンパイル使用メモリ | 261,780 KB |
| 最終ジャッジ日時 | 2025-02-24 15:16:09 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
| 純コード判定しない問題か言語 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep2(i,l,r) for(int i=l;i<(int)r;i++)
#define all(v) v.begin(),v.end()
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int N,M;
cin>>N>>M;
vector<int> A(M);
unordered_set<int> ok;
rep(i,M){
string S;
cin>>S;
rep(j,N)if(S[j]=='1')A[i]|=1<<j;
ok.insert(A[i]);
}
if(!ok.contains((1<<N)-1)||!ok.contains(0)){
cout<<"No\n";
return 0;
}
bool yes=1;
rep(i,M){
rep(j,M){
if(!ok.contains(A[i]&A[j]))yes=0;
if(!ok.contains(A[i]|A[j]))yes=0;
}
}
cout<<(yes?"Yes\n":"No\n");
}