結果

問題 No.63 ポッキーゲーム
ユーザー soi09476291soi09476291
提出日時 2019-11-19 08:04:33
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 777 ms / 5,000 ms
コード長 673 bytes
コンパイル時間 828 ms
コンパイル使用メモリ 108,292 KB
実行使用メモリ 26,072 KB
最終ジャッジ日時 2024-04-14 09:20:00
合計ジャッジ時間 4,699 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
23,648 KB
testcase_01 AC 25 ms
23,904 KB
testcase_02 AC 26 ms
23,984 KB
testcase_03 AC 25 ms
23,820 KB
testcase_04 AC 25 ms
21,808 KB
testcase_05 AC 25 ms
26,068 KB
testcase_06 AC 25 ms
22,060 KB
testcase_07 AC 25 ms
26,000 KB
testcase_08 AC 25 ms
24,032 KB
testcase_09 AC 25 ms
23,904 KB
testcase_10 AC 33 ms
25,944 KB
testcase_11 AC 777 ms
23,648 KB
testcase_12 AC 41 ms
23,772 KB
testcase_13 AC 775 ms
21,940 KB
testcase_14 AC 42 ms
26,072 KB
testcase_15 AC 41 ms
23,576 KB
testcase_16 AC 27 ms
23,688 KB
testcase_17 AC 731 ms
23,776 KB
testcase_18 AC 27 ms
23,768 KB
testcase_19 AC 127 ms
23,904 KB
testcase_20 AC 37 ms
24,240 KB
testcase_21 AC 56 ms
23,908 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Text;
using System.Linq;

namespace ConsoleApp11
{
    class Program
    {
        static void Main(string[] args)
        {
            long sum = 0;

            var input = Console.ReadLine().Split(' ');

            long L = long.Parse(input[0]);
            long K = long.Parse(input[1]);

            while (true)
            {
                if(L <= K * 2)
                {
                    break;
                }

                L -= K * 2;

                sum += K;

                if(L <= K * 2)
                {
                    break;
                }
            }
            Console.WriteLine(sum);
        }
    }
}
0