結果

問題 No.5005 3-SAT
ユーザー titan23titan23
提出日時 2022-06-24 12:59:51
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,304 bytes
コンパイル時間 266 ms
実行使用メモリ 86,996 KB
スコア 0
最終ジャッジ日時 2022-06-24 13:04:38
合計ジャッジ時間 205,571 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,994 ms
86,244 KB
testcase_01 AC 1,994 ms
85,700 KB
testcase_02 AC 1,993 ms
86,032 KB
testcase_03 AC 1,994 ms
86,236 KB
testcase_04 AC 1,992 ms
86,388 KB
testcase_05 AC 1,994 ms
86,732 KB
testcase_06 AC 1,993 ms
86,216 KB
testcase_07 AC 1,996 ms
85,740 KB
testcase_08 AC 1,992 ms
85,988 KB
testcase_09 AC 1,992 ms
85,696 KB
testcase_10 AC 1,994 ms
86,996 KB
testcase_11 TLE -
testcase_12 AC 1,994 ms
86,736 KB
testcase_13 AC 1,993 ms
86,056 KB
testcase_14 AC 1,995 ms
86,068 KB
testcase_15 TLE -
testcase_16 AC 1,990 ms
85,648 KB
testcase_17 AC 1,992 ms
86,568 KB
testcase_18 AC 1,989 ms
85,300 KB
testcase_19 TLE -
testcase_20 AC 1,998 ms
85,616 KB
testcase_21 AC 1,994 ms
85,856 KB
testcase_22 AC 1,993 ms
85,884 KB
testcase_23 AC 1,996 ms
86,004 KB
testcase_24 AC 1,993 ms
86,180 KB
testcase_25 AC 1,992 ms
86,416 KB
testcase_26 AC 1,994 ms
86,512 KB
testcase_27 AC 1,995 ms
85,624 KB
testcase_28 AC 1,992 ms
85,656 KB
testcase_29 AC 1,999 ms
86,160 KB
testcase_30 AC 1,992 ms
86,068 KB
testcase_31 AC 1,992 ms
85,812 KB
testcase_32 AC 1,991 ms
86,644 KB
testcase_33 AC 1,992 ms
85,424 KB
testcase_34 AC 1,993 ms
86,016 KB
testcase_35 AC 1,990 ms
85,836 KB
testcase_36 AC 1,989 ms
86,264 KB
testcase_37 AC 1,991 ms
85,844 KB
testcase_38 AC 1,992 ms
85,768 KB
testcase_39 AC 1,993 ms
86,004 KB
testcase_40 AC 1,990 ms
86,264 KB
testcase_41 AC 1,991 ms
85,984 KB
testcase_42 AC 1,992 ms
85,432 KB
testcase_43 AC 1,991 ms
86,000 KB
testcase_44 AC 1,991 ms
85,508 KB
testcase_45 TLE -
testcase_46 AC 1,992 ms
85,752 KB
testcase_47 AC 1,993 ms
85,800 KB
testcase_48 AC 1,991 ms
85,360 KB
testcase_49 AC 1,996 ms
86,232 KB
testcase_50 AC 1,993 ms
85,636 KB
testcase_51 AC 1,992 ms
85,984 KB
testcase_52 AC 1,991 ms
86,188 KB
testcase_53 AC 1,993 ms
86,408 KB
testcase_54 AC 1,996 ms
86,532 KB
testcase_55 AC 1,994 ms
85,808 KB
testcase_56 AC 1,992 ms
86,268 KB
testcase_57 AC 1,990 ms
86,204 KB
testcase_58 AC 1,993 ms
86,364 KB
testcase_59 AC 1,993 ms
86,544 KB
testcase_60 AC 1,992 ms
86,440 KB
testcase_61 AC 1,992 ms
86,308 KB
testcase_62 AC 1,990 ms
85,404 KB
testcase_63 AC 1,991 ms
85,520 KB
testcase_64 AC 1,990 ms
85,952 KB
testcase_65 AC 1,992 ms
85,828 KB
testcase_66 AC 1,994 ms
86,408 KB
testcase_67 AC 1,992 ms
86,040 KB
testcase_68 AC 1,991 ms
86,552 KB
testcase_69 AC 1,994 ms
85,956 KB
testcase_70 AC 1,990 ms
85,748 KB
testcase_71 AC 1,992 ms
85,896 KB
testcase_72 AC 1,990 ms
86,144 KB
testcase_73 AC 1,994 ms
86,500 KB
testcase_74 AC 1,992 ms
85,772 KB
testcase_75 AC 1,992 ms
85,672 KB
testcase_76 AC 1,990 ms
86,052 KB
testcase_77 AC 1,996 ms
85,844 KB
testcase_78 AC 1,992 ms
85,616 KB
testcase_79 AC 1,994 ms
86,132 KB
testcase_80 AC 1,991 ms
85,940 KB
testcase_81 TLE -
testcase_82 AC 1,987 ms
85,540 KB
testcase_83 AC 1,989 ms
86,732 KB
testcase_84 AC 1,988 ms
86,016 KB
testcase_85 AC 1,988 ms
85,656 KB
testcase_86 AC 1,986 ms
85,972 KB
testcase_87 AC 1,989 ms
85,824 KB
testcase_88 AC 1,988 ms
86,348 KB
testcase_89 AC 1,999 ms
85,936 KB
testcase_90 AC 1,988 ms
86,296 KB
testcase_91 AC 1,988 ms
86,188 KB
testcase_92 AC 1,988 ms
86,188 KB
testcase_93 AC 1,986 ms
86,432 KB
testcase_94 AC 1,987 ms
85,984 KB
testcase_95 AC 1,989 ms
86,140 KB
testcase_96 AC 1,988 ms
86,196 KB
testcase_97 AC 1,991 ms
86,052 KB
testcase_98 AC 1,986 ms
86,028 KB
testcase_99 AC 1,988 ms
86,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()
import random
from time import time

random.seed = 1
randint = random.randint
random = random.random

#  -----------------------  #

abcpqr = [tuple(map(int, input().split())) for _ in range(2048)]
STIME = time()

li = [[0, 0] for _ in range(2048)]
for a,b,c,p,q,r in abcpqr:
  li[a][p] += 1
  li[b][q] += 1
  li[c][r] += 1

def make_ans_init() -> list:
  ans = [-1] * 2048
  for a,b,c,p,q,r in abcpqr:
    if ans[a] != -1 or ans[b] != -1 or ans[c] != -1:
      continue
    ans[a] = p
    ans[b] = q
    ans[c] = r
  for i in range(2048):
    if ans[i] == -1:
      if li[i][0] < li[i][1]:
        ans[i] = 1
      else:
        ans[i] = 0 
  return ans

def eval_ans(ans) -> int:
  ret = 0
  for a,b,c,p,q,r in abcpqr:
    if ans[a] == p and ans[b] == q and ans[c] == r:
      ret += 1
  return ret

def make_ans_yamanobori(ans):
  preans = ans[:]
  for _ in range(5):
    indx = randint(0, 2047)
    ans[indx] = 1 - ans[indx]
  return preans

def main():
  ans = make_ans_init()
  vestscore = eval_ans(ans)
  while time()-STIME < 1.9:
    nans = make_ans_yamanobori(ans)
    score = eval_ans(nans)
    if score > vestscore:
      ans = nans[:]
      vestscore = score
  print(''.join(map(str, ans)))
  print(vestscore, file=sys.stderr)

main()
0