結果
| 問題 |
No.3311 フィルター
|
| コンテスト | |
| ユーザー |
テナガザル
|
| 提出日時 | 2025-10-24 22:23:50 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 678 bytes |
| コンパイル時間 | 625 ms |
| コンパイル使用メモリ | 100,480 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-10-25 12:57:24 |
| 合計ジャッジ時間 | 1,793 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 1 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
vector<int> check(1 << n);
for (int i = 0; i < m; ++i)
{
string s;
cin >> s;
int id = 0;
for (auto c : s) id = id * 2 + c - '0';
check[id] = 1;
}
if (check[0])
{
cout << "No" << endl;
return 0;
}
for (int i = 0; i < (1 << n); ++i)
{
if (!check[i]) continue;
int ans = 1;
for (int j = 0; j < n; ++j)
{
if (!(i & (1 << j)))
{
ans &= check[(i ^ (1 << j))];
}
}
if (ans == 0)
{
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
}
テナガザル