結果

問題 No.159 刺さらないUSB
ユーザー ともきともき
提出日時 2015-07-18 17:01:32
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 998 ms / 1,000 ms
コード長 1,169 bytes
コンパイル時間 12,264 ms
コンパイル使用メモリ 254,416 KB
実行使用メモリ 62,784 KB
最終ジャッジ日時 2023-09-14 16:40:59
合計ジャッジ時間 34,915 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 965 ms
62,048 KB
testcase_01 AC 971 ms
62,312 KB
testcase_02 AC 953 ms
61,976 KB
testcase_03 AC 952 ms
62,248 KB
testcase_04 AC 961 ms
62,036 KB
testcase_05 AC 951 ms
62,056 KB
testcase_06 AC 949 ms
62,024 KB
testcase_07 AC 957 ms
62,284 KB
testcase_08 AC 952 ms
62,784 KB
testcase_09 AC 966 ms
62,052 KB
testcase_10 AC 962 ms
62,348 KB
testcase_11 AC 956 ms
61,936 KB
testcase_12 AC 957 ms
62,096 KB
testcase_13 AC 958 ms
62,300 KB
testcase_14 AC 956 ms
62,272 KB
testcase_15 AC 951 ms
62,260 KB
testcase_16 AC 994 ms
62,500 KB
testcase_17 AC 998 ms
62,352 KB
testcase_18 AC 961 ms
62,364 KB
testcase_19 AC 955 ms
62,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn.readLine
import scala.collection.mutable.PriorityQueue
import scala.annotation.tailrec

// PriorityQueue[Long]()(scala.math.Ordering.Long.reverse)
package net.pushl {
  package number {
    // Prime  (Prime.scala)
    // Number (Number.scala)
  }
  package string {
    // RollingHash (RollingHash.scala)
  }
  package geometry {
    // Point
    // Segment
    // Line
  }
  object EnRich {
    implicit class AString(val self : String) extends AnyVal {
      def splitToIntVector    = self.split(" ").map(_.toInt).toVector
      def splitToDoubleVector = self.split(" ").map(_.toDouble).toVector
      def splitToDoubleTuple2 = splitTuple2(() => splitToDoubleVector)
      def splitToIntTuple2    = splitTuple2(() => splitToIntVector)
      private def splitTuple2[X](splitTo: () => Vector[X]) = {
        val ab = splitTo()
        (ab(0),ab(1))
      }
    }
  }
}

import net.pushl.EnRich._
object Main {
  def solve(p: Double, q: Double) = {
    val p1 = (1-p)*q
    val p2 = p*(1-q)*q
    if(p1 < p2) "YES" else "NO"
  }
  def main(args : Array[String]) : Unit = {
    val (p,q) = readLine.splitToDoubleTuple2
    println(solve(p,q))
  }
}
0