結果

問題 No.669 対決!!! 飲み比べ
ユーザー NoNo
提出日時 2018-04-07 04:20:21
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 824 bytes
コンパイル時間 2,273 ms
コンパイル使用メモリ 109,264 KB
実行使用メモリ 25,764 KB
最終ジャッジ日時 2023-09-08 18:10:34
合計ジャッジ時間 5,220 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 61 ms
21,740 KB
testcase_04 AC 62 ms
21,724 KB
testcase_05 AC 61 ms
21,856 KB
testcase_06 AC 61 ms
23,844 KB
testcase_07 AC 61 ms
23,644 KB
testcase_08 AC 59 ms
21,680 KB
testcase_09 AC 60 ms
21,708 KB
testcase_10 AC 60 ms
21,792 KB
testcase_11 AC 61 ms
23,796 KB
testcase_12 AC 60 ms
21,600 KB
testcase_13 AC 61 ms
21,608 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 68 ms
21,932 KB
testcase_24 WA -
testcase_25 AC 60 ms
23,716 KB
testcase_26 AC 61 ms
21,680 KB
testcase_27 AC 61 ms
21,812 KB
testcase_28 AC 61 ms
21,656 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.Linq;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int n = int.Parse(ss[0]);
            int k = int.Parse(ss[1]);
            var a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

            int z = a.Count(x => x == 0);
            int w = 0;
            int l = z;

            foreach (var item in a)
            {
                if (item == 0) continue;
                if (item % (k + 1) == 0)
                {
                    l++;
                }
                else
                {
                    w++;
                }
            }

            var ans = w ^ l;
            Console.WriteLine((ans % 2) == 0 ? "YES" : "NO");
        }
    }
}
0