結果

問題 No.2155 みちらcolor
ユーザー bluemeganebluemegane
提出日時 2022-12-10 07:16:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 915 bytes
コンパイル時間 1,148 ms
コンパイル使用メモリ 113,660 KB
実行使用メモリ 30,464 KB
最終ジャッジ日時 2024-04-22 23:38:38
合計ジャッジ時間 5,050 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
26,992 KB
testcase_01 AC 29 ms
28,472 KB
testcase_02 AC 30 ms
25,972 KB
testcase_03 AC 27 ms
25,968 KB
testcase_04 AC 28 ms
25,856 KB
testcase_05 AC 30 ms
28,012 KB
testcase_06 AC 28 ms
27,884 KB
testcase_07 AC 25 ms
25,788 KB
testcase_08 AC 30 ms
28,512 KB
testcase_09 AC 30 ms
28,044 KB
testcase_10 AC 29 ms
25,972 KB
testcase_11 AC 27 ms
25,720 KB
testcase_12 AC 28 ms
26,104 KB
testcase_13 AC 24 ms
25,972 KB
testcase_14 AC 31 ms
26,868 KB
testcase_15 AC 25 ms
27,784 KB
testcase_16 AC 27 ms
25,704 KB
testcase_17 AC 26 ms
25,768 KB
testcase_18 AC 30 ms
26,608 KB
testcase_19 AC 30 ms
26,108 KB
testcase_20 AC 30 ms
28,784 KB
testcase_21 AC 31 ms
26,352 KB
testcase_22 AC 31 ms
26,332 KB
testcase_23 AC 31 ms
28,008 KB
testcase_24 AC 32 ms
28,996 KB
testcase_25 AC 32 ms
26,740 KB
testcase_26 AC 32 ms
26,972 KB
testcase_27 AC 34 ms
27,296 KB
testcase_28 AC 32 ms
28,776 KB
testcase_29 AC 31 ms
28,392 KB
testcase_30 AC 32 ms
27,180 KB
testcase_31 AC 30 ms
24,116 KB
testcase_32 AC 30 ms
26,736 KB
testcase_33 AC 33 ms
26,800 KB
testcase_34 AC 33 ms
26,736 KB
testcase_35 AC 32 ms
26,992 KB
testcase_36 AC 33 ms
26,868 KB
testcase_37 AC 33 ms
26,992 KB
testcase_38 AC 30 ms
25,968 KB
testcase_39 AC 32 ms
26,604 KB
testcase_40 AC 34 ms
30,056 KB
testcase_41 AC 34 ms
30,464 KB
testcase_42 AC 25 ms
27,916 KB
testcase_43 AC 24 ms
25,712 KB
testcase_44 AC 25 ms
25,972 KB
testcase_45 AC 26 ms
26,000 KB
testcase_46 AC 25 ms
25,908 KB
testcase_47 AC 26 ms
26,184 KB
testcase_48 AC 26 ms
25,972 KB
testcase_49 AC 26 ms
25,776 KB
testcase_50 AC 25 ms
23,984 KB
testcase_51 AC 25 ms
27,860 KB
testcase_52 AC 25 ms
27,716 KB
testcase_53 AC 25 ms
26,096 KB
testcase_54 AC 27 ms
25,840 KB
testcase_55 AC 26 ms
25,884 KB
testcase_56 AC 26 ms
25,808 KB
testcase_57 AC 25 ms
26,256 KB
testcase_58 AC 25 ms
26,096 KB
testcase_59 AC 24 ms
25,872 KB
testcase_60 AC 25 ms
27,916 KB
testcase_61 AC 25 ms
25,716 KB
testcase_62 AC 26 ms
28,248 KB
testcase_63 AC 25 ms
27,920 KB
testcase_64 AC 25 ms
26,224 KB
testcase_65 AC 25 ms
27,752 KB
testcase_66 AC 26 ms
27,916 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Collections.Generic;
using System.Linq;
using System;

public class Hello
{
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var m = int.Parse(line[1]);
        var L = int.Parse(line[2]);
        line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        getAns(n, m, L, a);
    }
    static void getAns(int n, int m, int L, int[] a)
    {
        var hs = new HashSet<int>[n];
        for (int i = 0; i < n; i++) hs[i] = new HashSet<int>();
        hs[0].Add(L);
        hs[0].Add((L + a[0]) / 2);
        for (int i = 1; i < n; i++)
        {
            foreach (var x in hs[i - 1])
            {
                hs[i].Add(x);
                hs[i].Add((x + a[i]) / 2);
            }
        }
        Console.WriteLine(hs[n - 1].Contains(m) ? "Yes" : "No");
    }
}
0