結果

問題 No.2270 T0空間
ユーザー Nzt3Nzt3
提出日時 2023-04-14 22:28:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 548 ms / 2,000 ms
コード長 756 bytes
コンパイル時間 2,309 ms
コンパイル使用メモリ 199,060 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-18 19:59:01
合計ジャッジ時間 6,688 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 56 ms
5,376 KB
testcase_12 AC 32 ms
5,376 KB
testcase_13 AC 134 ms
5,376 KB
testcase_14 AC 141 ms
5,376 KB
testcase_15 AC 140 ms
5,376 KB
testcase_16 AC 271 ms
5,376 KB
testcase_17 AC 548 ms
5,376 KB
testcase_18 AC 535 ms
5,376 KB
testcase_19 AC 255 ms
5,376 KB
testcase_20 AC 254 ms
5,376 KB
testcase_21 AC 257 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N,M;
  cin>>N>>M;
  vector<bitset<256>>S(M);
  for(int i=0;i<M;i++){
    char c;
    for(int j=0;j<N;j++){
      cin>>c;
      if(c=='0'){
        S[i].set(j,0);
      }else{
        S[i].set(j,1);
      }
    }
  }
  vector<bitset<256>>ans(N);
  for(int i=0;i<M;i++){
    bitset<256>T,F;
    for(int j=0;j<N;j++){
      if(S[i].test(j)){
        T.set(j,1);
      }else{
        F.set(j,1);
      }
    }
    for(int j=0;j<N;j++){
      if(S[i].test(j)){
        ans[j]|=F;
      }else{
        ans[j]|=T;
      }
    }
  }
  for(int i=0;i<N;i++){
    if(ans[i].count()<N-1){
      cout<<"No\n";
      return 0;
    }
  }
  cout<<"Yes\n";
}
0