結果

問題 No.2270 T0空間
ユーザー 👑 chro_96chro_96
提出日時 2023-04-14 22:25:31
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 189 ms / 2,000 ms
コード長 724 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 31,360 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-18 19:55:22
合計ジャッジ時間 2,991 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,248 KB
testcase_01 AC 3 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 3 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 3 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 22 ms
5,376 KB
testcase_12 AC 13 ms
5,376 KB
testcase_13 AC 50 ms
5,376 KB
testcase_14 AC 48 ms
5,376 KB
testcase_15 AC 49 ms
5,376 KB
testcase_16 AC 92 ms
5,376 KB
testcase_17 AC 189 ms
5,376 KB
testcase_18 AC 189 ms
5,376 KB
testcase_19 AC 114 ms
5,376 KB
testcase_20 AC 110 ms
5,376 KB
testcase_21 AC 112 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main () {
  int n = 0;
  int m = 0;
  char s[257] = "";
  
  int res = 0;
  
  long long v[256][1100] = {};
  int is_ok = 1;
  
  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++) {
      if (s[j] == '1') {
        v[j][i/60] |= (1LL<<((long long)(i%60)));
      }
    }
  }
  
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) {
      int tmp_ok = 0;
      for (int k = 0; k <= (m-1)/60; k++) {
        if (v[i][k] != v[j][k]) {
          tmp_ok = 1;
        }
      }
      is_ok *= tmp_ok;
    }
  }
  
  if (is_ok > 0) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  
  return 0;
}
0