結果

問題 No.1664 Unstable f(n)
ユーザー 👑 kakel-sankakel-san
提出日時 2024-01-04 23:47:29
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 905 bytes
コンパイル時間 6,907 ms
コンパイル使用メモリ 158,428 KB
実行使用メモリ 37,944 KB
最終ジャッジ日時 2024-01-04 23:47:49
合計ジャッジ時間 13,767 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
34,468 KB
testcase_01 AC 58 ms
31,268 KB
testcase_02 AC 55 ms
31,012 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 55 ms
31,012 KB
testcase_07 AC 54 ms
31,012 KB
testcase_08 AC 54 ms
31,012 KB
testcase_09 AC 57 ms
31,012 KB
testcase_10 AC 56 ms
31,012 KB
testcase_11 AC 583 ms
31,268 KB
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 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (98 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var n = long.Parse(ReadLine());
        var ans = n + 1;
        for (var i = 2; i <= ans; ++i)
        {
            var j = 0;
            var ij = 1L;
            var tmp = n;
            while (tmp >= i)
            {
                ++j;
                ij *= i;
                tmp /= i;
            }
            // WriteLine($"{i} {j} {ij} {tmp}");
            ans = Math.Min(ans, i + j + n - ij);
        }
        WriteLine(ans);
    }
}
0