結果

問題 No.2270 T0空間
ユーザー chro_96
提出日時 2023-04-14 22:16:04
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 498 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 29,696 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-10 13:06:23
合計ジャッジ時間 2,609 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main () {
  int n = 0;
  int m = 0;
  char s[257] = "";
  
  int res = 0;
  
  int v[256] = {};
  int cnt[4] = {};
  
  res = scanf("%d", &n);
  res = scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    res = scanf("%s", s);
    for (int j = 0; j < n; j++) {
      v[j] |= (1<<((int)(s[j]-'0')));
    }
  }
  
  for (int i = 0; i < n; i++) {
    cnt[v[i]]++;
  }
  
  if (cnt[1] > 1 || cnt[2] > 1) {
    printf("No\n");
  } else {
    printf("Yes\n");
  }
  
  return 0;
}
0