結果

問題 No.312 置換処理
ユーザー letrangerletranger
提出日時 2017-04-09 01:29:42
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 138 bytes
コンパイル時間 36 ms
コンパイル使用メモリ 11,392 KB
実行使用メモリ 15,708 KB
最終ジャッジ日時 2023-09-24 23:41:43
合計ジャッジ時間 5,796 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,452 KB
testcase_01 AC 130 ms
15,612 KB
testcase_02 AC 155 ms
15,500 KB
testcase_03 AC 157 ms
15,436 KB
testcase_04 AC 81 ms
15,620 KB
testcase_05 AC 82 ms
15,524 KB
testcase_06 AC 84 ms
15,700 KB
testcase_07 AC 102 ms
15,380 KB
testcase_08 AC 82 ms
15,520 KB
testcase_09 AC 82 ms
15,504 KB
testcase_10 AC 83 ms
15,432 KB
testcase_11 AC 89 ms
15,388 KB
testcase_12 AC 81 ms
15,648 KB
testcase_13 AC 80 ms
15,632 KB
testcase_14 AC 80 ms
15,676 KB
testcase_15 AC 81 ms
15,552 KB
testcase_16 AC 80 ms
15,568 KB
testcase_17 AC 81 ms
15,624 KB
testcase_18 AC 80 ms
15,392 KB
testcase_19 AC 82 ms
15,504 KB
testcase_20 AC 80 ms
15,652 KB
testcase_21 AC 81 ms
15,692 KB
testcase_22 AC 80 ms
15,624 KB
testcase_23 WA -
testcase_24 AC 81 ms
15,472 KB
testcase_25 AC 82 ms
15,556 KB
testcase_26 AC 80 ms
15,512 KB
testcase_27 AC 81 ms
15,564 KB
testcase_28 AC 81 ms
15,524 KB
testcase_29 AC 80 ms
15,388 KB
testcase_30 AC 91 ms
15,668 KB
testcase_31 AC 80 ms
15,492 KB
testcase_32 AC 86 ms
15,552 KB
testcase_33 AC 102 ms
15,676 KB
testcase_34 AC 103 ms
15,472 KB
testcase_35 AC 83 ms
15,388 KB
testcase_36 AC 80 ms
15,644 KB
testcase_37 AC 79 ms
15,468 KB
testcase_38 AC 80 ms
15,680 KB
testcase_39 AC 82 ms
15,648 KB
testcase_40 AC 81 ms
15,708 KB
testcase_41 AC 81 ms
15,444 KB
testcase_42 AC 81 ms
15,472 KB
testcase_43 AC 80 ms
15,476 KB
testcase_44 AC 81 ms
15,636 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def f(n)
  (3..(n**0.5).floor).each{|i|
    return i if n % i == 0
  }
  return n/2 if n % 2 == 0
  return n
end

N = gets.to_i
puts f(N)
0