結果

問題 No.63 ポッキーゲーム
ユーザー ototonariototonari
提出日時 2017-03-16 21:49:44
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 818 ms / 5,000 ms
コード長 877 bytes
コンパイル時間 1,872 ms
コンパイル使用メモリ 101,952 KB
実行使用メモリ 22,768 KB
最終ジャッジ日時 2023-08-25 19:23:01
合計ジャッジ時間 6,558 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
22,712 KB
testcase_01 AC 58 ms
20,768 KB
testcase_02 AC 56 ms
20,664 KB
testcase_03 AC 56 ms
20,592 KB
testcase_04 AC 56 ms
20,716 KB
testcase_05 AC 56 ms
20,712 KB
testcase_06 AC 56 ms
20,716 KB
testcase_07 AC 58 ms
20,652 KB
testcase_08 AC 58 ms
20,828 KB
testcase_09 AC 58 ms
20,804 KB
testcase_10 AC 65 ms
18,732 KB
testcase_11 AC 818 ms
20,652 KB
testcase_12 AC 73 ms
20,732 KB
testcase_13 AC 818 ms
22,688 KB
testcase_14 AC 72 ms
18,880 KB
testcase_15 AC 72 ms
20,664 KB
testcase_16 AC 59 ms
20,672 KB
testcase_17 AC 774 ms
20,644 KB
testcase_18 AC 58 ms
20,768 KB
testcase_19 AC 159 ms
22,768 KB
testcase_20 AC 70 ms
20,820 KB
testcase_21 AC 90 ms
20,652 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;
using System.Text;
using System.Threading.Tasks;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] t = s.Split(' ');
            int L = int.Parse(t[0]);
            int K = int.Parse(t[1]);
            int haruka = 0;
            int c = L;
            while(0 < c)
            {
                if(c - (K * 2) <= 0)
                {
                    haruka += c;
                    c = 0;
                }
                else
                {
                    c -= (K * 2);
                    haruka += K;
                }
            }

            Console.WriteLine("{0}", (L - haruka));
            //Console.ReadLine();

        }
    }
}
0