結果

問題 No.669 対決!!! 飲み比べ
ユーザー NoNo
提出日時 2018-03-23 23:52:19
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 928 bytes
コンパイル時間 2,788 ms
コンパイル使用メモリ 106,784 KB
実行使用メモリ 25,796 KB
最終ジャッジ日時 2023-09-07 04:46:37
合計ジャッジ時間 5,971 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 62 ms
21,588 KB
testcase_04 AC 61 ms
21,740 KB
testcase_05 AC 60 ms
21,852 KB
testcase_06 AC 61 ms
23,636 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 61 ms
21,740 KB
testcase_11 AC 63 ms
23,744 KB
testcase_12 AC 63 ms
23,696 KB
testcase_13 AC 62 ms
23,672 KB
testcase_14 AC 61 ms
21,828 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 62 ms
23,624 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 60 ms
21,756 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 61 ms
23,688 KB
testcase_26 AC 59 ms
21,704 KB
testcase_27 AC 60 ms
23,836 KB
testcase_28 AC 60 ms
19,544 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++;
                }
            }


            if (w != 0 && w % 2 == 0)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}
0