This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enter file contents hereimport java.io.FileReader | |
import scala.io.StdIn | |
import scala.math | |
object DynamicGrid extends App { | |
val fileName = "sample" | |
// val fileName = "D-small-practice" | |
// val fileName = "D-large-practice" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Main { | |
def solve(nl : List[Double], kl: List[Double]) = { | |
val dwar = (nl.sorted zip kl.sorted).filter(t => t._1 > t._2).size | |
def solveWarKwin(nl : List[Double], kl: List[Double]):Int = { | |
if(nl.size == 1) { | |
if(nl.head < kl.head) 1 else 0 | |
} else if (nl.size == 0 ){ | |
0 | |
} else { |