結果

問題 No.1468 Colourful Pastel
ユーザー yumechi
提出日時 2021-04-08 02:36:23
言語 Scala(Beta)
(3.8.2)
コンパイル:
scalac _filename_
実行:
/usr/bin/scala_run _class_
結果
AC  
実行時間 873 ms / 1,000 ms
+ 2µs
コード長 545 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 7,471 ms
コンパイル使用メモリ 288,700 KB
実行使用メモリ 85,216 KB
最終ジャッジ日時 2026-07-28 17:07:45
合計ジャッジ時間 22,398 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt

  def makeMap(): Map[String, Int] = {
    Map(
      "Red" -> 0,
      "Orange" -> 0,
      "Yellow" -> 0,
      "Green" -> 0,
      "Cyan" -> 0,
      "Blue" -> 0,
      "Violet" -> 0,
    )
  }

  var a = makeMap()
  for(col <- Array.fill(n)(sc.next)) {
    val t = a(col) + 1
    a += col -> t
  }
  for(col <- Array.fill(n - 1)(sc.next)) {
    val t = a(col) + 1
    a += col -> t
  }

  println(a.keys.filter(a(_) % 2 == 1).head)
}
0