結果

問題 No.669 対決!!! 飲み比べ
ユーザー NoNo
提出日時 2018-03-31 00:26:56
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,026 bytes
コンパイル時間 4,342 ms
コンパイル使用メモリ 108,076 KB
実行使用メモリ 23,932 KB
最終ジャッジ日時 2023-09-08 07:46:00
合計ジャッジ時間 5,043 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,664 KB
testcase_01 AC 61 ms
23,728 KB
testcase_02 AC 61 ms
23,676 KB
testcase_03 AC 59 ms
21,616 KB
testcase_04 AC 59 ms
21,712 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 59 ms
21,636 KB
testcase_08 AC 59 ms
21,564 KB
testcase_09 AC 59 ms
21,708 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 58 ms
19,636 KB
testcase_15 WA -
testcase_16 AC 60 ms
21,780 KB
testcase_17 WA -
testcase_18 AC 61 ms
21,688 KB
testcase_19 WA -
testcase_20 AC 59 ms
23,708 KB
testcase_21 WA -
testcase_22 AC 62 ms
21,744 KB
testcase_23 AC 68 ms
21,764 KB
testcase_24 AC 67 ms
23,728 KB
testcase_25 AC 59 ms
21,748 KB
testcase_26 AC 59 ms
21,792 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++;
                }
            }

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