結果
| 問題 |
No.669 対決!!! 飲み比べ
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2018-04-07 04:28:20 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 842 bytes |
| コンパイル時間 | 863 ms |
| コンパイル使用メモリ | 106,112 KB |
| 実行使用メモリ | 19,968 KB |
| 最終ジャッジ日時 | 2024-06-26 10:56:15 |
| 合計ジャッジ時間 | 2,546 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 17 WA * 8 |
コンパイルメッセージ
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++;
}
}
var ans = w ^ l;
Console.WriteLine(ans == n || (ans % 2) == 0 ? "YES" : "NO");
}
}
}
No