結果
問題 |
No.5005 3-SAT
|
ユーザー |
![]() |
提出日時 | 2024-07-22 20:24:54 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 950 bytes |
コンパイル時間 | 172 ms |
コンパイル使用メモリ | 81,972 KB |
実行使用メモリ | 77,824 KB |
スコア | 0 |
最終ジャッジ日時 | 2024-07-22 20:25:09 |
合計ジャッジ時間 | 13,051 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 100 |
ソースコード
import random import sys def make_testcase(): C = [] for i in range(2048): C.append([int(i) for i in input().split()]) # sub = [] # for j in range(3): # sub.append(random.randrange(256)) # sub.append(random.randint(0, 1)) # C.append(sub[:]) return C C = make_testcase() k = 0 nowans = k nowscore = 0 table = [C[0]] print(table) ends = 3 while 1: if ends == 0: break ends -= 1 for row in table: if k >> row[0] & 1 == row[1]: continue if k >> row[2] & 1 == row[3]: continue if k >> row[4] & 1 == row[5]: continue tar = random.choice(row[::2]) k ^= 1 << tar break else: nowscore += 1 nowans = k # print(f"score={nowscore} sol={bin(k)[2:]}", file=sys.stderr) table.append(C[nowscore]) ends = 6 * (nowscore + 1) print(bin(k)[2:])