結果

問題 No.750 Frac #1
コンテスト
ユーザー neko_the_shadow
提出日時 2018-12-02 16:55:21
言語 Scala
(3.10.0 + ACL)
コンパイル:
scalac -cp /opt/aclib/ac-library-scala.jar _filename_
実行:
/usr/bin/scala_run _class_
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 273 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 12,175 ms
コンパイル使用メモリ 380,712 KB
最終ジャッジ日時 2026-10-30 17:39:29
合計ジャッジ時間 13,788 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
-- [E008] Not Found Error: Main.scala:3:15 -------------------------------------
3 |    val n = io.StdIn.readLine().toInt
  |            ^^^^^^^^
  |            value StdIn is not a member of io
-- [E008] Not Found Error: Main.scala:4:28 -------------------------------------
4 |    Range(0, n).map(_ => io.StdIn.readLine()).sortBy(line => {
  |                         ^^^^^^^^
  |                         value StdIn is not a member of io
-- [E007] Type Mismatch Error: Main.scala:5:19 ---------------------------------
5 |      val tokens = line.split(' ').map(_.toDouble).toSeq
  |                   ^^^^
  |Found:    (line : Nothing)
  |Required: ?{ split: ? }
  |Note that implicit conversions were not tried because the result of an implicit conversion
  |must be more specific than ?{ split: [applied to (' ') returning ?{ map: [applied to (_$2 => _$2.toDouble
  |  ) returning ?{ toSeq: <?> }] }] }
  |
  | longer explanation available when compiling with `-explain`
-- [E172] Type Error: Main.scala:7:6 -------------------------------------------
7 |    }).reverse.foreach(println)
  |      ^
  |Ambiguous given instances: both object Boolean in object Ordering and object Int in object Ordering match type Ordering[B] of parameter ord of method sortBy in trait SeqOps
-- [E100] Syntax Warning: Main.scala:7:23 --------------------------------------
7 |    }).reverse.foreach(println)
  |                       ^^^^^^^
  |                       method[0

ソースコード

diff #
raw source code

object Q750 {
  def main(args: Array[String]) = {
    val n = io.StdIn.readLine().toInt
    Range(0, n).map(_ => io.StdIn.readLine()).sortBy(line => {
      val tokens = line.split(' ').map(_.toDouble).toSeq
      tokens(0) / tokens(1)
    }).reverse.foreach(println)
  }
}
0