結果
問題 | No.2911 位相の公理 |
ユーザー |
|
提出日時 | 2024-10-04 23:31:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,967 bytes |
コンパイル時間 | 2,305 ms |
コンパイル使用メモリ | 171,452 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-04 23:31:38 |
合計ジャッジ時間 | 6,567 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 6 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define int long longconst int p=998244353;int po(int a,int b) {if(b==0) return 1; if(b==1) return a; if(b%2==0) {int u=po(a,b/2);return (u*1LL*u)%p;} else {int u=po(a,b-1);return (a*1LL*u)%p;}}int inv(int x) {return po(x,p-2);}mt19937 rnd;#define app push_back#define all(x) (x).begin(),(x).end()#ifdef LOCAL#define debug(...) [](auto...a){ ((cout << a << ' '), ...) << endl;}(#__VA_ARGS__, ":", __VA_ARGS__)#define debugv(v) do {cout<< #v <<" : {"; for(int izxc=0;izxc<v.size();++izxc) {cout << v[izxc];if(izxc+1!=v.size()) cout << ","; }cout <<"}"<< endl;}while(0)#else#define debug(...)#define debugv(v)#endif#define lob(a,x) lower_bound(all(a),x)#define upb(a,x) upper_bound(all(a),x)const int maxn=1e5+5;int par[maxn];int get(int x){if(par[x]==(-1)) return x;int ans=get(par[x]);par[x]=ans;return ans;}void merg(int x,int y){x=get(x);y=get(y);if(x!=y) par[x]=y;}int f(string s){int u=0;for(int i=0;i<s.size();++i) if(s[i]=='1') u+=(1<<i);return u;}bool al[1<<16];int32_t main(){ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);int n,m;cin>>n>>m;string s[m];for(int i=0;i<m;++i) {cin>>s[i];}for(int i=0;i<m;++i) {al[(f(s[i]))]=1;}//if(al.size()!=m) {cout<<"No";return 0;;}string t;for(int i=0;i<n;++i) t.app('1');if(!al[(f(t))]) {cout<<"No";return 0;}//t.clear();for(int i=0;i<n;++i) t.app('0');//if(!al[(f(t))]) {cout<<"No";return 0;}for(int i=0;i<m;++i){for(int j=0;j<=i;++j){string s1,s2;s1.resize(n);s2.resize(n);for(int k=0;k<n;++k){//s1[k]='0'+(s[i][k]-'0')^(s[j][k]-'0');s2[k]='0'+(s[i][k]-'0') & (s[j][k]-'0');}//if(!al[(f(s1))]) {cout<<"No";return 0;}if(!al[(f(s2))]) {cout<<"No";return 0;}}}cout<<"Yes";return 0;return 0;}