結果

問題 No.669 対決!!! 飲み比べ
ユーザー NoNo
提出日時 2018-03-31 00:22:55
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,026 bytes
コンパイル時間 2,696 ms
コンパイル使用メモリ 104,316 KB
実行使用メモリ 25,852 KB
最終ジャッジ日時 2023-09-08 07:45:41
合計ジャッジ時間 5,867 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
21,644 KB
testcase_01 AC 57 ms
21,576 KB
testcase_02 AC 57 ms
21,648 KB
testcase_03 AC 57 ms
19,676 KB
testcase_04 AC 57 ms
21,568 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 57 ms
21,576 KB
testcase_08 AC 57 ms
21,816 KB
testcase_09 AC 56 ms
21,636 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 57 ms
21,644 KB
testcase_16 AC 55 ms
19,628 KB
testcase_17 AC 58 ms
23,716 KB
testcase_18 AC 58 ms
23,668 KB
testcase_19 AC 57 ms
23,704 KB
testcase_20 AC 57 ms
19,784 KB
testcase_21 AC 59 ms
21,784 KB
testcase_22 AC 60 ms
21,816 KB
testcase_23 AC 67 ms
21,788 KB
testcase_24 AC 67 ms
21,900 KB
testcase_25 AC 58 ms
21,716 KB
testcase_26 AC 58 ms
21,632 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 && w % 2 == 1)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}
0