結果

問題 No.1852 Divide or Reduce
ユーザー yudedakoyudedako
提出日時 2022-03-01 13:08:47
言語 Scala(Beta)
(3.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 567 bytes
コンパイル時間 13,354 ms
コンパイル使用メモリ 250,904 KB
実行使用メモリ 98,536 KB
最終ジャッジ日時 2023-09-22 02:08:01
合計ジャッジ時間 55,346 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 947 ms
63,168 KB
testcase_01 AC 1,614 ms
68,956 KB
testcase_02 AC 1,582 ms
67,612 KB
testcase_03 AC 1,596 ms
67,628 KB
testcase_04 AC 1,678 ms
70,000 KB
testcase_05 AC 1,640 ms
70,072 KB
testcase_06 AC 1,551 ms
78,796 KB
testcase_07 AC 1,535 ms
93,780 KB
testcase_08 AC 1,525 ms
94,868 KB
testcase_09 AC 1,528 ms
83,816 KB
testcase_10 AC 1,525 ms
97,136 KB
testcase_11 AC 1,519 ms
98,116 KB
testcase_12 AC 1,531 ms
98,392 KB
testcase_13 AC 1,550 ms
98,328 KB
testcase_14 AC 1,539 ms
95,580 KB
testcase_15 AC 1,556 ms
98,536 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.collection.mutable.*
import scala.io.StdIn.*
import scala.util.chaining.*
import scala.math.*
import scala.reflect.ClassTag
import scala.util.*
import scala.annotation.tailrec
import scala.collection.mutable


@main def main =
  val testCase = readLine.toInt
  for _ <- 0 until testCase do
    val n = readLine.toInt
    val pile = readLine.split(' ').map(_.toLong)
    val min = pile.min
    val sum = pile.sum
    val firstWin = (sum - n) % 2 == 1 || (n % 2 == 0 && min % 2 == 0)
    println{
      if firstWin then "First"
      else "Second"
    }

0