結果

問題 No.1232 2^x = x
ユーザー simansiman
提出日時 2020-10-23 12:56:37
言語 Ruby
(3.3.0)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 138 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 11,264 KB
実行使用メモリ 15,372 KB
最終ジャッジ日時 2023-09-28 15:21:04
合計ジャッジ時間 2,291 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
15,372 KB
testcase_01 AC 96 ms
15,080 KB
testcase_02 AC 97 ms
15,076 KB
testcase_03 AC 98 ms
15,364 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'

N = gets.to_i
P = N.times.map { gets.to_i }

P.each do |v|
  if v == 2
    puts 2
  else
    puts (v - 1) ** 2
  end
end
0