Objets/Documentation
adresses12.py
Je fournis cette pièce pour examiner ou reproduire le contrôle AT.COD4.
Télécharger ↓"""Fixed-transition address with dense or active state lists, independently enumerated."""
from collections import Counter
from functools import lru_cache
from itertools import product
from random import Random
from statistics import median
from time import perf_counter_ns
import argparse,json,zlib
from flux11 import encode,decode
class Index:
def __init__(self,word,dense):
self.s=word[0];self.t=word[-1]
self.symbols=range(max(word)+1) if dense else sorted(set(word))
counts=Counter(zip(word,word[1:]))
self.edges=sorted(product(self.symbols,repeat=2)) if dense else sorted(counts)