結果

問題 No.1664 Unstable f(n)
ユーザー simansiman
提出日時 2021-10-25 06:24:45
言語 Ruby
(3.2.2)
結果
WA  
実行時間 -
コード長 180 bytes
コンパイル時間 618 ms
コンパイル使用メモリ 11,384 KB
実行使用メモリ 20,180 KB
最終ジャッジ日時 2023-07-25 22:19:04
合計ジャッジ時間 8,341 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
19,680 KB
testcase_01 AC 94 ms
15,252 KB
testcase_02 AC 80 ms
15,372 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 81 ms
15,176 KB
testcase_08 AC 81 ms
15,180 KB
testcase_09 AC 80 ms
15,304 KB
testcase_10 WA -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
ans = N + 1

2.upto(Math.log2(N).floor) do |j|
  i = 2

  while i ** j < N
    k = N - i ** j
    v = i + j + k
    ans = v if ans > v
    i += 1
  end
end

puts ans
0