結果

問題 No.5 数字のブロック
ユーザー iwkjoseciwkjosec
提出日時 2018-02-23 06:08:16
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 450 bytes
コンパイル時間 1,210 ms
コンパイル使用メモリ 112,592 KB
実行使用メモリ 28,120 KB
最終ジャッジ日時 2024-04-15 14:38:07
合計ジャッジ時間 3,625 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
27,184 KB
testcase_01 AC 32 ms
27,444 KB
testcase_02 WA -
testcase_03 AC 38 ms
26,000 KB
testcase_04 AC 37 ms
23,860 KB
testcase_05 AC 40 ms
26,032 KB
testcase_06 AC 38 ms
28,000 KB
testcase_07 AC 38 ms
25,688 KB
testcase_08 AC 38 ms
27,944 KB
testcase_09 AC 36 ms
25,520 KB
testcase_10 AC 39 ms
25,908 KB
testcase_11 AC 39 ms
28,120 KB
testcase_12 AC 38 ms
25,876 KB
testcase_13 AC 39 ms
25,908 KB
testcase_14 AC 30 ms
23,352 KB
testcase_15 AC 36 ms
27,764 KB
testcase_16 AC 39 ms
26,044 KB
testcase_17 AC 40 ms
26,156 KB
testcase_18 AC 40 ms
26,028 KB
testcase_19 AC 40 ms
26,036 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 31 ms
25,264 KB
testcase_24 AC 35 ms
25,776 KB
testcase_25 AC 35 ms
27,516 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 37 ms
26,060 KB
testcase_30 AC 36 ms
25,908 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.IO;
using static System.Console;

class Program
{
    static void Main()
    {
        var L = int.Parse(ReadLine());
        ReadLine();
        var dp = ReadLine().Split().Select(int.Parse).ToList();
        dp.Sort();
        var c = 0;
        for (int i = 0; i <= L && c < dp.Count; c++)
        {
            i += dp[c];
        }
        WriteLine(c - 1);
    }
}
0