結果

問題 No.2416 vs Slime
ユーザー Maeda
提出日時 2025-04-02 15:03:37
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 7,871 ms
コンパイル使用メモリ 171,776 KB
実行使用メモリ 187,960 KB
最終ジャッジ日時 2025-04-02 15:03:50
合計ジャッジ時間 11,740 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 37
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (110 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

    class Program
    {
        static void Main(string[] args)
        {
            string[] slimes = Console.ReadLine().Split(' ');
            ulong count = 1;
            ulong hp = ulong.Parse(slimes[0]);
            ulong attack = 0;
            while(hp > 0)
            {
                attack+= count;
                hp = hp / ulong.Parse(slimes[1]);
                if(hp > 0)
                {
                    count *= 2;
                }
            }
            Console.WriteLine(attack);
        }
    }
0