結果

問題 No.63 ポッキーゲーム
ユーザー _mi_lin__mi_lin_
提出日時 2019-04-09 14:33:25
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 772 bytes
コンパイル時間 2,573 ms
コンパイル使用メモリ 101,440 KB
実行使用メモリ 24,888 KB
最終ジャッジ日時 2023-09-14 15:50:52
合計ジャッジ時間 4,188 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 55 ms
18,900 KB
testcase_02 WA -
testcase_03 AC 57 ms
22,824 KB
testcase_04 AC 57 ms
22,832 KB
testcase_05 AC 57 ms
20,936 KB
testcase_06 AC 57 ms
20,820 KB
testcase_07 AC 57 ms
20,772 KB
testcase_08 AC 56 ms
20,768 KB
testcase_09 WA -
testcase_10 AC 57 ms
20,712 KB
testcase_11 WA -
testcase_12 AC 56 ms
20,764 KB
testcase_13 AC 56 ms
20,952 KB
testcase_14 AC 56 ms
22,772 KB
testcase_15 AC 57 ms
22,816 KB
testcase_16 AC 57 ms
22,764 KB
testcase_17 AC 57 ms
20,792 KB
testcase_18 AC 56 ms
20,956 KB
testcase_19 AC 57 ms
20,820 KB
testcase_20 AC 57 ms
20,780 KB
testcase_21 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 No63Pokkey
{
    class Program
    {
        static void Main(string[] args)
        {
            //整数の入力
            string[] number = Console.ReadLine().Split(' ');

            int L = int.Parse(number[0]);
            int K = int.Parse(number[1]);

            //L/Kが余る場合
            int ans = 0;

            if (L % K != 0)
            {
                ans = K * ((L / K) / 2);
            }

            //L/Kが余らない場合
            else if (L % K == 0)
            {
                ans = (K * ((L / K) / 2)) - K;
            }

            //表示
            Console.WriteLine(ans);

        }
    }
}
0