結果
問題 | No.2090 否定論理積と充足可能性 |
ユーザー |
![]() |
提出日時 | 2022-09-30 21:52:34 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 467 bytes |
コンパイル時間 | 151 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-22 23:21:33 |
合計ジャッジ時間 | 1,669 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
import sysa = list(map(int, input().split()))n = len(a)def nand(x, y):return 0 if x == 1 and y == 1 else 1for b in range(1 << n):c = [1 if (b & (1 << i)) else 0 for i in range(n)]ok = Truefor i in range(n):for j in range(i + 1, n):if c[i] != c[j] and a[i] == a[j]:ok = Falsebreakif not ok:continueif nand(nand(nand(c[0], c[1]), c[2]), nand(nand(c[3], c[4]), c[5])):print("YES")sys.exit()print("NO")