結果

問題 No.669 対決!!! 飲み比べ
ユーザー NoNo
提出日時 2018-04-07 04:28:20
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 842 bytes
コンパイル時間 2,519 ms
コンパイル使用メモリ 106,480 KB
実行使用メモリ 25,784 KB
最終ジャッジ日時 2023-09-08 18:10:39
合計ジャッジ時間 5,503 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,828 KB
testcase_01 AC 59 ms
21,836 KB
testcase_02 AC 59 ms
21,648 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 59 ms
21,664 KB
testcase_06 AC 61 ms
21,644 KB
testcase_07 AC 60 ms
23,796 KB
testcase_08 AC 59 ms
23,684 KB
testcase_09 AC 60 ms
23,688 KB
testcase_10 AC 60 ms
21,780 KB
testcase_11 AC 61 ms
23,704 KB
testcase_12 AC 60 ms
23,736 KB
testcase_13 AC 60 ms
23,664 KB
testcase_14 AC 60 ms
21,784 KB
testcase_15 AC 59 ms
21,644 KB
testcase_16 WA -
testcase_17 AC 61 ms
21,724 KB
testcase_18 WA -
testcase_19 AC 60 ms
21,640 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 68 ms
23,804 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 60 ms
21,680 KB
testcase_28 AC 59 ms
21,720 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++;
                }
            }
      
            var ans = w ^ l;
            Console.WriteLine(ans == n || (ans % 2) == 0 ? "YES" : "NO");
        }
    }
}
0