結果

問題 No.663 セルオートマトンの逆操作
ユーザー Mr.FukuMr.Fuku
提出日時 2018-08-06 19:39:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 619 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 11,952 KB
実行使用メモリ 10,216 KB
最終ジャッジ日時 2023-10-19 22:17:00
合計ジャッジ時間 2,309 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,160 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 29 ms
10,160 KB
testcase_06 WA -
testcase_07 AC 30 ms
10,160 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 30 ms
10,160 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 29 ms
10,160 KB
testcase_18 AC 29 ms
10,160 KB
testcase_19 AC 29 ms
10,160 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
cell = ["000","001","010","011","100","101","110","111"]
dic = {"000":0,"001":1,"010":1,"011":1,"100":0,"101":1,"110":1,"111":0}

def check(nummber,x,s_i=0,t_i=3):
    n_set = set()
    for n in nummber:
        if dic[n]==x:
            n_set.add(n[s_i:t_i])
    return n_set

x = int(input())
start_c = check(cell,x,0,3)
c = check(start_c,x,1,3)
for i in range(n-1):
    lst = []
    for j in c:
        lst.append(j+"0")
        lst.append(j+"1")
    x = int(input())
    c = check(lst,x,1,3)

cnt = 0
for i in c:
    for j in range(2):
        if i+str(j) in start_c:
            cnt+=1

print(cnt)
0