atcoder.twosat.TwoSAT

class atcoder.twosat.TwoSAT(n: int = 0)

2-SAT

Reference: B. Aspvall, M. Plass, and R. Tarjan, A Linear-Time Algorithm for Testing the Truth of Certain Quantified Boolean Formulas

Methods

__init__(n: int = 0) None
add_clause(i: int, f: bool, j: int, g: bool) None
answer() List[bool]
satisfiable() bool