結果

問題 No.1232 2^x = x
ユーザー yudedakoyudedako
提出日時 2022-01-26 22:08:09
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,015 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 13,298 ms
コンパイル使用メモリ 251,324 KB
実行使用メモリ 62,660 KB
最終ジャッジ日時 2023-08-25 10:51:03
合計ジャッジ時間 18,406 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 945 ms
61,960 KB
testcase_01 AC 999 ms
62,428 KB
testcase_02 AC 1,007 ms
62,124 KB
testcase_03 AC 1,015 ms
62,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.annotation.tailrec
import scala.io.StdIn.*
import scala.math.*

@main def main =
  val n = readLine().toInt
  val prime = Array.fill(n){readLine().toInt}
  for p <- prime do
    if p == 2 then
      println(2)
    else
      println((p - 1L) * (p - 1L))
0