結果
| 問題 |
No.2911 位相の公理
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-04 21:59:40 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,295 bytes |
| コンパイル時間 | 1,333 ms |
| コンパイル使用メモリ | 132,592 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-04 21:59:44 |
| 合計ジャッジ時間 | 4,479 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 WA * 3 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <atcoder/modint>
#include <iomanip>
using mint = atcoder::modint1000000007;
using namespace std;
typedef long long ll;
const int INF = 1<<30;
const ll INFLL = 1LL<<60;
const ll MOD = 1000000007; //998244353;
using Graph = vector<vector<int>>;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
int n, m; cin >> n >> m;
vector<ll> S(m);
for (int i = 0; i < m; i++){
string s; cin >> s;
int val = 0;
for (int j = 0; j < n; j++) if (s[j] == '1') val += 1<<j;
S[i] = val;
}
sort(S.begin(), S.end());
bool ok1 = false;
bool ok2 = true;
for (int i = 0 ; i < m; i++){
if (S[i] == 1<<(n-1)) ok1 = true;
for (int j = i+1; j < m; j++){
ll OR = S[i] | S[j];
ll AND = S[i] & S[j];
auto it_or = lower_bound(S.begin(), S.end(), OR);
auto it_and = lower_bound(S.begin(), S.end(), AND);
if (it_or == S.end() || *it_or != OR) ok2 = false;
if (it_and == S.end() || *it_and != AND) ok2 = false;
}
}
cout << (ok1 && ok2 ? "Yes" : "No") << '\n';
}