結果
| 問題 | No.2911 位相の公理 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-12 12:49:56 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 634 ms / 2,000 ms |
| コード長 | 691 bytes |
| 記録 | |
| コンパイル時間 | 1,151 ms |
| コンパイル使用メモリ | 220,260 KB |
| 実行使用メモリ | 9,208 KB |
| 最終ジャッジ日時 | 2026-07-05 22:21:34 |
| 合計ジャッジ時間 | 3,809 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<bool> tb(1 << n), dp(1 << n);
vector<int> a(m);
bitset<16> tmp;
dp[0] = true;
for(auto &&v : a){
cin >> tmp;
v = tmp.to_ullong();
tb[v] = true;
for(int j = dp.size() - 1; j >= 0; j--){
if(dp[j]) dp[j | v] = true;
}
}
for(int i = 0; i < n; i++){
for(int j = 0; j < i; j++){
if(!tb[a[i] & a[j]]){
cout << "No\n";
exit(0);
}
}
}
cout << (dp == tb && tb.back() ? "Yes" : "No") << '\n';
}