結果

問題 No.2155 みちらcolor
コンテスト
ユーザー kakel-san
提出日時 2023-09-05 21:54:29
言語 C#(csc)
(csc 3.9.0)
コンパイル:
csc -langversion:latest -unsafe -warn:0 -o+ /r:System.Numerics.dll _filename_ -out:a.exe
実行:
/usr/bin/mono a.exe
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 907 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 592 ms
コンパイル使用メモリ 112,476 KB
実行使用メモリ 27,900 KB
最終ジャッジ日時 2026-03-08 18:51:43
合計ジャッジ時間 3,354 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 64
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #
raw source code

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var (n, m, l) = (c[0], c[1], c[2]);
        var a = NList;
        var dp = new bool[1001];
        dp[l] = true;
        foreach (var ai in a)
        {
            var next = new bool[1001];
            for (var i = 0; i < dp.Length; ++i)
            {
                next[i] |= dp[i];
                next[(i + ai) / 2] |= dp[i];
            }
            dp = next;
        }
        WriteLine(dp[m] ? "Yes" : "No");
    }
}
0