結果

問題 No.63 ポッキーゲーム
ユーザー fujitafujita
提出日時 2023-04-25 11:26:07
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 49 ms / 5,000 ms
コード長 906 bytes
コンパイル時間 7,222 ms
コンパイル使用メモリ 167,128 KB
実行使用メモリ 182,964 KB
最終ジャッジ日時 2024-04-26 17:47:43
合計ジャッジ時間 9,214 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
28,544 KB
testcase_01 AC 46 ms
28,788 KB
testcase_02 AC 46 ms
28,476 KB
testcase_03 AC 48 ms
28,416 KB
testcase_04 AC 46 ms
28,544 KB
testcase_05 AC 46 ms
28,416 KB
testcase_06 AC 46 ms
28,800 KB
testcase_07 AC 48 ms
28,672 KB
testcase_08 AC 49 ms
28,544 KB
testcase_09 AC 48 ms
28,788 KB
testcase_10 AC 46 ms
28,416 KB
testcase_11 AC 47 ms
28,672 KB
testcase_12 AC 48 ms
28,800 KB
testcase_13 AC 47 ms
28,788 KB
testcase_14 AC 48 ms
28,416 KB
testcase_15 AC 48 ms
28,544 KB
testcase_16 AC 47 ms
28,544 KB
testcase_17 AC 48 ms
28,800 KB
testcase_18 AC 47 ms
28,544 KB
testcase_19 AC 46 ms
28,672 KB
testcase_20 AC 48 ms
28,416 KB
testcase_21 AC 48 ms
182,964 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (81 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
namespace yukicoder
{
    class Program
    {

        static void Main(string[] args)
        {
            var L = Console.ReadLine();
            var z = L.Split(" ");
            int[] ints = new int[z.Length];
            //文字分割
            for (int i = 0; i < z.Length; i++)
            {
                ints[i] = int.Parse(z[i]);
            }

            if (ints[0] <= ints[1] * 2)
            {
                Console.WriteLine("0");
            }
            else if ((ints[0] % (ints[1] * 2) == 0))
            {
                int temp = ints[0] / (ints[1] * 2);
                int ans = temp * ints[1] - ints[1];
                Console.WriteLine(ans);
            }
            else 
            {
                int temp = ints[0] / (ints[1] * 2);
                int ans = temp * ints[1];
                Console.WriteLine(ans);
            }
        }
    }
}
0