結果

問題 No.617 Nafmo、買い出しに行く
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-08-09 02:17:58
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 689 ms / 2,000 ms
コード長 592 bytes
コンパイル時間 850 ms
コンパイル使用メモリ 110,636 KB
実行使用メモリ 47,396 KB
最終ジャッジ日時 2023-10-24 11:57:57
合計ジャッジ時間 8,779 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
25,536 KB
testcase_01 AC 33 ms
25,536 KB
testcase_02 AC 35 ms
25,536 KB
testcase_03 AC 63 ms
25,872 KB
testcase_04 AC 33 ms
25,536 KB
testcase_05 AC 98 ms
27,180 KB
testcase_06 AC 600 ms
47,396 KB
testcase_07 AC 601 ms
47,396 KB
testcase_08 AC 33 ms
25,532 KB
testcase_09 AC 33 ms
25,532 KB
testcase_10 AC 689 ms
47,396 KB
testcase_11 AC 670 ms
47,396 KB
testcase_12 AC 680 ms
47,396 KB
testcase_13 AC 664 ms
47,396 KB
testcase_14 AC 663 ms
47,396 KB
testcase_15 AC 656 ms
47,396 KB
testcase_16 AC 653 ms
47,396 KB
testcase_17 AC 661 ms
47,396 KB
testcase_18 AC 33 ms
25,532 KB
testcase_19 AC 33 ms
25,532 KB
testcase_20 AC 35 ms
25,532 KB
testcase_21 AC 33 ms
25,536 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.Linq;
using System.Collections.Generic;

class No617{
    static void Main(){
        var omosaMax=Console.ReadLine().Split(' ').Select(x=>Int32.Parse(x)).ToArray();
        List<int>list=new List<int>();
        list.Add(0);
        for(int i=0;i<omosaMax[0];++i){
            var omosa=Int32.Parse(Console.ReadLine());
            var listLength=list.Count;
            for(int j=0;j<listLength;++j){
                list.Add(list[j]+omosa);
            }
        }
        Console.WriteLine(list.OrderByDescending(x=>x).Where(x=>x<=omosaMax[1]).First());
    }
}
0