Submission #1242804


Source Code Expand

fun main(args:Array<String>) {
  val (w, a, b) = readLine()!!.split(" ").map { x -> x.toInt() }
  val (a1, a2) = Pair(a - w, a + w)
  if( a1 <= b && b <+ a2 ) {
    println(0)
  }else {
    println( listOf(a1, a2).map { x ->
      b - x
    }.map { x ->
      Math.abs(x)
    }.min() )
  }
}

Submission Info

Submission Time
Task B - NarrowRectanglesEasy
User lightning
Language Kotlin (1.0.0)
Score 200
Code Size 303 Byte
Status AC
Exec Time 235 ms
Memory 30064 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 10
Set Name Test Cases
Sample 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt
All 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt
Case Name Status Exec Time Memory
0_000.txt AC 232 ms 28060 KB
0_001.txt AC 231 ms 30000 KB
0_002.txt AC 233 ms 27896 KB
0_003.txt AC 231 ms 28072 KB
1_004.txt AC 232 ms 30064 KB
1_005.txt AC 232 ms 28208 KB
1_006.txt AC 235 ms 27956 KB
1_007.txt AC 232 ms 28024 KB
1_008.txt AC 234 ms 28152 KB
1_009.txt AC 233 ms 27980 KB