class AtCoder::TwoSat
- AtCoder::TwoSat
- Reference
- Object
Overview
Implements atcoder::two_sat
twosat = AtCoder::TwoSat.new(2_i64)
twosat.add_clause(0, true, 1, false)
twosat.add_clause(1, true, 0, false)
twosat.add_clause(0, false, 1, false)
twosat.satisfiable? # => true
twosat.answer # => [false, false]
Defined in:
two_sat.crConstructors
Instance Method Summary
-
#add_clause(i, f, j, g)
Implements atcoder::two_sat.add_clause(i, f, j, g).
-
#answer
Implements atcoder::two_sat.answer().
-
#satisfiable?
Implements atcoder::two_sat.satisfiable().
- #size : Int64
Constructor Detail
Instance Method Detail
def answer
#
Implements atcoder::two_sat.answer().
This method will raise NotSatisfiableError
if it's not satisfiable.