結果

問題 No.1831 Parasol
ユーザー yudedakoyudedako
提出日時 2022-02-18 10:51:06
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,259 ms / 2,000 ms
コード長 771 bytes
コンパイル時間 11,112 ms
コンパイル使用メモリ 256,740 KB
実行使用メモリ 72,532 KB
最終ジャッジ日時 2023-09-11 18:05:26
合計ジャッジ時間 33,620 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 958 ms
61,208 KB
testcase_01 AC 1,259 ms
72,308 KB
testcase_02 AC 970 ms
62,340 KB
testcase_03 AC 969 ms
62,648 KB
testcase_04 AC 1,248 ms
72,532 KB
testcase_05 AC 980 ms
62,524 KB
testcase_06 AC 962 ms
62,576 KB
testcase_07 AC 1,238 ms
71,400 KB
testcase_08 AC 968 ms
62,628 KB
testcase_09 AC 974 ms
62,616 KB
testcase_10 AC 1,172 ms
66,868 KB
testcase_11 AC 1,237 ms
72,408 KB
testcase_12 AC 1,139 ms
65,144 KB
testcase_13 AC 1,253 ms
71,280 KB
testcase_14 AC 1,044 ms
62,968 KB
testcase_15 AC 1,090 ms
62,672 KB
testcase_16 AC 986 ms
62,540 KB
testcase_17 AC 991 ms
62,892 KB
testcase_18 AC 1,058 ms
62,232 KB
testcase_19 AC 995 ms
62,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
import scala.io.StdIn.*
import scala.util.chaining.*
import scala.math.*
import scala.util._


@main def main =
  val n = readLine.toInt
  val result = ArrayBuffer[List[Int]]()
  result.addOne((n until 2 * n).toList.reverse)
  result.addOne((n until 2 * n).toList.reverse)
  for i <- 0 until n - 1 do
    var list = List(n - 1)
    for j <- 0 until n do
      if i != j then
        list ::= n + j
    result.addOne(list)
  for i <- 1 to n - 2 do
    var list = Nil: List[Int]
    for j <- n - 1 - i until n - 1 do
      list ::= j
    for j <- 2 * n - (n - i) until 2 * n  do
      list ::= j
    result.addOne(list)
  println(result.size)
  println(result.map(_.mkString(" ")).mkString("\n"))
0