結果
問題 |
No.669 対決!!! 飲み比べ
|
ユーザー |
![]() |
提出日時 | 2018-03-31 00:22:55 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,026 bytes |
コンパイル時間 | 1,184 ms |
コンパイル使用メモリ | 112,680 KB |
実行使用メモリ | 27,296 KB |
最終ジャッジ日時 | 2024-06-26 01:03:00 |
合計ジャッジ時間 | 3,308 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 2 |
other | AC * 18 WA * 7 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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"); } } } }