結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 61 ms
23,696 KB
testcase_04 AC 61 ms
21,780 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 61 ms
21,752 KB
testcase_08 AC 61 ms
21,800 KB
testcase_09 AC 60 ms
19,652 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 61 ms
23,712 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 61 ms
21,696 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 72 ms
23,832 KB
testcase_25 AC 62 ms
21,668 KB
testcase_26 AC 60 ms
21,660 KB
testcase_27 WA -
testcase_28 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.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((w ^ l % 2) == 0 ? "YES" : "NO");
        }
    }
}
0