結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,796 KB
testcase_01 AC 62 ms
19,688 KB
testcase_02 AC 61 ms
23,780 KB
testcase_03 AC 60 ms
21,668 KB
testcase_04 AC 61 ms
21,704 KB
testcase_05 AC 61 ms
19,684 KB
testcase_06 AC 60 ms
21,764 KB
testcase_07 AC 61 ms
23,796 KB
testcase_08 AC 62 ms
23,740 KB
testcase_09 AC 60 ms
21,832 KB
testcase_10 AC 61 ms
21,828 KB
testcase_11 AC 62 ms
21,656 KB
testcase_12 AC 61 ms
21,840 KB
testcase_13 AC 60 ms
21,724 KB
testcase_14 WA -
testcase_15 AC 61 ms
21,788 KB
testcase_16 WA -
testcase_17 AC 62 ms
21,736 KB
testcase_18 AC 60 ms
21,660 KB
testcase_19 AC 60 ms
23,776 KB
testcase_20 WA -
testcase_21 AC 60 ms
21,692 KB
testcase_22 AC 61 ms
23,640 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 60 ms
21,800 KB
testcase_26 AC 60 ms
23,720 KB
testcase_27 AC 60 ms
21,784 KB
testcase_28 AC 61 ms
23,836 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 == 1)
            {
                Console.WriteLine("YES");
            }
            else if (w != 0 && l % 2 == 0)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}
0