結果

問題 No.5 数字のブロック
ユーザー 富浜富浜
提出日時 2015-03-05 23:01:48
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 668 bytes
コンパイル時間 1,783 ms
コンパイル使用メモリ 100,768 KB
実行使用メモリ 23,308 KB
最終ジャッジ日時 2023-09-06 13:48:24
合計ジャッジ時間 5,131 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
20,728 KB
testcase_01 AC 55 ms
20,704 KB
testcase_02 RE -
testcase_03 AC 61 ms
19,084 KB
testcase_04 AC 61 ms
23,136 KB
testcase_05 AC 62 ms
21,140 KB
testcase_06 AC 63 ms
21,140 KB
testcase_07 AC 64 ms
21,032 KB
testcase_08 AC 60 ms
23,048 KB
testcase_09 AC 62 ms
20,968 KB
testcase_10 AC 62 ms
23,228 KB
testcase_11 AC 59 ms
23,104 KB
testcase_12 AC 63 ms
21,128 KB
testcase_13 AC 62 ms
23,148 KB
testcase_14 AC 49 ms
20,780 KB
testcase_15 AC 61 ms
20,768 KB
testcase_16 AC 66 ms
21,136 KB
testcase_17 AC 65 ms
21,300 KB
testcase_18 AC 67 ms
23,308 KB
testcase_19 AC 65 ms
21,304 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 52 ms
20,656 KB
testcase_24 AC 58 ms
22,812 KB
testcase_25 AC 57 ms
22,920 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 59 ms
21,136 KB
testcase_30 AC 58 ms
22,960 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
namespace csharptest
{
    class Program
    {
        static void Main(string[] args)
        {
            int l = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int[] w = new int[n];
            string[] str = Console.ReadLine().Split(' ');
            for (int m = 0; m < str.Length; m++)
            {
                w[m] = int.Parse(str[m]);
            }
            Array.Sort(w);
            int count = -1, box = 0;
            while (l >= box||count==n)
            {
                count++;
                box += w[count];
            }
            Console.WriteLine(count);
        }
    }
}
0