Submission #1379169


Source Code Expand

import java.lang.Math
fun main( args : Array<String> ) {
  val n = readLine()!!.toInt()
  var bs = (1..n).map {
    readLine()!!.toInt()
  }.sortedBy { x ->
   x*-1
  }.mapIndexed { i,x ->
    val ret = when {
      i%2 == 0 -> x*x
      else     -> -1*x*x
    }
    ret
  }
  val a = bs.reduce { x,y ->
    x+y
  }
  println( a*Math.PI )
}

Submission Info

Submission Time
Task B - N重丸
User lightning
Language Kotlin (1.0.0)
Score 100
Code Size 360 Byte
Status AC
Exec Time 243 ms
Memory 36300 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 21
Set Name Test Cases
Sample example_0.txt, example_1.txt
All example_0.txt, example_1.txt, maxrand_0.txt, maxrand_1.txt, maxrand_2.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt, special_0.txt, special_1.txt, special_2.txt, special_3.txt, example_0.txt, example_1.txt
Case Name Status Exec Time Memory
example_0.txt AC 224 ms 34288 KB
example_1.txt AC 224 ms 32200 KB
maxrand_0.txt AC 243 ms 34104 KB
maxrand_1.txt AC 240 ms 35900 KB
maxrand_2.txt AC 241 ms 35952 KB
random_0.txt AC 229 ms 36024 KB
random_1.txt AC 230 ms 35940 KB
random_2.txt AC 239 ms 35892 KB
random_3.txt AC 232 ms 35904 KB
random_4.txt AC 225 ms 35808 KB
random_5.txt AC 229 ms 33976 KB
random_6.txt AC 236 ms 35984 KB
random_7.txt AC 239 ms 34024 KB
random_8.txt AC 238 ms 35984 KB
random_9.txt AC 236 ms 35900 KB
special_0.txt AC 206 ms 31688 KB
special_1.txt AC 223 ms 36300 KB
special_2.txt AC 204 ms 31740 KB
special_3.txt AC 223 ms 32192 KB