結果

問題 No.63 ポッキーゲーム
ユーザー ooh_18ooh_18
提出日時 2017-05-29 12:35:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 770 ms / 5,000 ms
コード長 616 bytes
コンパイル時間 3,721 ms
コンパイル使用メモリ 106,196 KB
実行使用メモリ 23,976 KB
最終ジャッジ日時 2023-08-25 19:29:46
合計ジャッジ時間 6,873 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,916 KB
testcase_01 AC 59 ms
21,912 KB
testcase_02 AC 59 ms
21,916 KB
testcase_03 AC 58 ms
23,836 KB
testcase_04 AC 58 ms
21,916 KB
testcase_05 AC 58 ms
23,892 KB
testcase_06 AC 59 ms
21,848 KB
testcase_07 AC 58 ms
23,888 KB
testcase_08 AC 59 ms
21,836 KB
testcase_09 AC 60 ms
21,932 KB
testcase_10 AC 68 ms
21,780 KB
testcase_11 AC 756 ms
21,772 KB
testcase_12 AC 76 ms
23,884 KB
testcase_13 AC 770 ms
21,780 KB
testcase_14 AC 74 ms
21,948 KB
testcase_15 AC 75 ms
23,904 KB
testcase_16 AC 61 ms
21,932 KB
testcase_17 AC 712 ms
23,976 KB
testcase_18 AC 61 ms
23,884 KB
testcase_19 AC 138 ms
22,020 KB
testcase_20 AC 71 ms
23,892 KB
testcase_21 AC 87 ms
23,900 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.Collections.Generic;
using System.Linq;

namespace lecture
{
    class MainClass
    {
        public static void Main(string[] args)
        {

            int[] tmp = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
            int L = tmp[0];
            int K = tmp[1];

            int count = 0;
            while(L > 0)
            {
                L -= 2 * K;
                count += K;
            }
            if (L/2 < count)
            {
                count -= K;
            }
            
            Console.WriteLine(count);
        }
    }
}
0