結果
| 問題 |
No.3311 フィルター
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-10-24 23:11:42 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 703 bytes |
| コンパイル時間 | 1,495 ms |
| コンパイル使用メモリ | 198,696 KB |
| 実行使用メモリ | 7,724 KB |
| 最終ジャッジ日時 | 2025-10-25 12:57:46 |
| 合計ジャッジ時間 | 2,311 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 1 |
ソースコード
#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 << 20);
string s;
for(int i = 0; i < m; i++){
cin >> s;
int vl = 0;
for(int j = 0; j < n; j++){
if(s[j] == '1') vl |= 1 << j;
}
tb[vl] = true;
}
if(tb[0]){
cout << "No\n";
return 0;
}
for(int i = 0; i < n; i++){
for(int S = 0; S < (1 << n); S++){
if(S >> i & 1) continue;
if(tb[S] && !tb[S | (1 << i)]){
cout << "No\n";
return 0;
}
}
}
cout << "Yes\n";
}