File tree Expand file tree Collapse file tree 4 files changed +13
-12
lines changed
src/main/scala/io/github/acl4s Expand file tree Collapse file tree 4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change 88 fail-fast : false
99 matrix :
1010 name : [ "test" ]
11- scala : [ 3.3.0, 3.3 .1 ]
11+ scala : [ 3.3.0, 3.4 .1 ]
1212 java : [ 20, 21 ]
1313 include :
1414 - name : " format"
15- scala : 3.3 .1
15+ scala : 3.4 .1
1616 java : 21
1717 exclude :
1818 - name : " test"
Original file line number Diff line number Diff line change 1- lazy val supportedScalaVersions = List (" 3.3 .1" , " 3.3.0" )
1+ lazy val supportedScalaVersions = List (" 3.4 .1" , " 3.3.0" )
22
33lazy val root = project
44 .in(file(" ." ))
Original file line number Diff line number Diff line change @@ -90,8 +90,7 @@ object Modulus {
9090 inline def apply [T <: Int ](): Modulus [T ] = Mod (compiletime.constValue[T ])
9191}
9292
93- final case class StaticModInt [T <: Int ] private (private [this ] var _value : Int )(using m : Modulus [T ])
94- extends ModIntBase [T ] {
93+ final case class StaticModInt [T <: Int ] private (private var _value : Int )(using m : Modulus [T ]) extends ModIntBase [T ] {
9594 override type Self = StaticModInt [T ]
9695 override val mod : T = m.value
9796
@@ -204,7 +203,7 @@ object ModInt998244353 {
204203 def apply (value : Long ): ModInt998244353 = StaticModInt (value)
205204}
206205
207- final case class DynamicModInt private (private [ this ] var _value : Int ) extends ModIntBase [Int ] {
206+ final case class DynamicModInt private (private var _value : Int ) extends ModIntBase [Int ] {
208207 override type Self = DynamicModInt
209208 override val mod : Int = DynamicModInt .bt.m
210209
Original file line number Diff line number Diff line change 11package io .github .acl4s
22
3+ import scala .util .boundary , boundary .break
4+
35/**
46 * Reference:
57 * B. Aspvall, M. Plass, and R. Tarjan,
@@ -28,12 +30,12 @@ class TwoSAT(private val n: Int) {
2830
2931 def satisfiable (): Boolean = {
3032 val (_, id) = scc.sccIds()
31- (0 until n).foreach(i => {
32- if (id(2 * i) == id(2 * i + 1 )) {
33- return false
33+ boundary {
34+ for (i <- 0 until n) {
35+ if (id(2 * i) == id(2 * i + 1 )) { break(false ) }
36+ answer(i) = id(2 * i) < id(2 * i + 1 )
3437 }
35- answer(i) = id(2 * i) < id(2 * i + 1 )
36- })
37- true
38+ true
39+ }
3840 }
3941}
You can’t perform that action at this time.
0 commit comments