結果

問題 No.2090 否定論理積と充足可能性
ユーザー とりゐとりゐ
提出日時 2022-09-30 22:35:21
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 2,253 ms
コンパイル使用メモリ 86,692 KB
実行使用メモリ 71,520 KB
最終ジャッジ日時 2023-08-24 16:09:57
合計ジャッジ時間 3,380 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,904 KB
testcase_01 AC 68 ms
71,140 KB
testcase_02 AC 70 ms
71,164 KB
testcase_03 AC 70 ms
71,124 KB
testcase_04 AC 71 ms
71,148 KB
testcase_05 AC 71 ms
70,932 KB
testcase_06 AC 72 ms
71,268 KB
testcase_07 AC 72 ms
71,144 KB
testcase_08 AC 70 ms
71,212 KB
testcase_09 AC 71 ms
71,144 KB
testcase_10 AC 71 ms
71,168 KB
testcase_11 AC 71 ms
71,256 KB
testcase_12 AC 70 ms
71,148 KB
testcase_13 AC 72 ms
71,148 KB
testcase_14 AC 71 ms
71,520 KB
testcase_15 AC 71 ms
71,128 KB
testcase_16 AC 70 ms
71,144 KB
testcase_17 AC 72 ms
71,184 KB
testcase_18 AC 72 ms
70,992 KB
testcase_19 AC 72 ms
71,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c,d,e,f=map(int,input().split())
s=set([a,b,c,d,e,f])
s=list(s)
n=len(s)

def NAND(x,y):
  if x==y==1:
    return 0
  else:
    return 1

for bit in range(1<<n):
  dic={}
  for i in range(n):
    if (bit>>i)&1:
      dic[s[i]]=1
    else:
      dic[s[i]]=0
  
  if NAND(NAND(NAND(dic[a],dic[b]),dic[c]),NAND(NAND(dic[d],dic[e]),dic[f]))==1:
    print('YES')
    exit()

print('NO')
0