結果

問題 No.617 Nafmo、買い出しに行く
ユーザー _matumo__matumo_
提出日時 2018-09-12 16:16:15
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 164 ms / 2,000 ms
コード長 710 bytes
コンパイル時間 2,208 ms
コンパイル使用メモリ 106,484 KB
実行使用メモリ 46,980 KB
最終ジャッジ日時 2023-09-09 09:24:48
合計ジャッジ時間 5,565 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
23,944 KB
testcase_01 AC 65 ms
21,940 KB
testcase_02 AC 66 ms
21,912 KB
testcase_03 AC 77 ms
26,608 KB
testcase_04 AC 64 ms
21,900 KB
testcase_05 AC 89 ms
31,480 KB
testcase_06 AC 65 ms
21,912 KB
testcase_07 AC 65 ms
19,924 KB
testcase_08 AC 64 ms
21,768 KB
testcase_09 AC 64 ms
21,848 KB
testcase_10 AC 144 ms
46,192 KB
testcase_11 AC 156 ms
46,084 KB
testcase_12 AC 137 ms
41,364 KB
testcase_13 AC 164 ms
46,980 KB
testcase_14 AC 164 ms
43,528 KB
testcase_15 AC 118 ms
40,124 KB
testcase_16 AC 118 ms
42,132 KB
testcase_17 AC 135 ms
41,964 KB
testcase_18 AC 65 ms
21,796 KB
testcase_19 AC 65 ms
23,896 KB
testcase_20 AC 64 ms
21,960 KB
testcase_21 AC 65 ms
21,936 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.Collections.Generic;
using System.Linq;
using System.Text;

namespace YukiCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var va = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var ha = new List<int>() { 0 };
            for (int i = 0; i < va[0]; i++)
            {
                int na = int.Parse(Console.ReadLine());
                var hb = ha.Select(n => n + na).ToList();
                ha.AddRange(hb);
                ha = ha.Distinct().ToList();
            }
            int nMax = ha.Where(n => n <= va[1]).Max();
            Console.WriteLine(nMax);
            Console.ReadLine();
        }
    }
}
0