結果
| 問題 | No.2911 位相の公理 |
| コンテスト | |
| ユーザー |
n0ma_ru
|
| 提出日時 | 2024-10-04 21:41:53 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 22 ms / 2,000 ms |
| コード長 | 870 bytes |
| 記録 | |
| コンパイル時間 | 1,163 ms |
| コンパイル使用メモリ | 220,784 KB |
| 実行使用メモリ | 16,768 KB |
| 最終ジャッジ日時 | 2026-07-05 20:59:13 |
| 合計ジャッジ時間 | 2,688 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ALL(v) v.begin(),v.end()
#define dbg(x) cerr << #x << ": " << (x) << endl;
int n,m;
vector<int> a;
vector<bool> ex;
int main() {
cin >> n >> m;
ex.resize(1 << n);
a.resize(m);
for (int i = 0; i < m; ++i) {
string s;
cin >> s;
int x = 0;
for (int i = 0; i < n; ++i) {
if (s[i] == '1') x |= 1 << i;
}
a[i] = x;
ex[x] = true;
}
int tgt = (1 << n)-1;
if (!ex[tgt]) {
cout << "No\n";
return 0;
}
if (!ex[0]) {
cout << "No\n";
return 0;
}
for (int i = 0; i < m; ++i) {
for (int j = i+1; j < m; ++j) {
if (!ex[a[i] & a[j]]) {
cout << "No\n";
return 0;
}
}
}
cout << "Yes\n";
}
n0ma_ru