結果

問題 No.5 数字のブロック
ユーザー 富浜富浜
提出日時 2015-03-05 23:05:20
言語 C#(csc)
(csc 3.9.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 836 bytes
コンパイル時間 2,257 ms
コンパイル使用メモリ 102,220 KB
実行使用メモリ 24,556 KB
最終ジャッジ日時 2023-09-06 13:48:38
合計ジャッジ時間 5,940 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,680 KB
testcase_01 AC 61 ms
22,700 KB
testcase_02 AC 57 ms
20,684 KB
testcase_03 AC 71 ms
21,148 KB
testcase_04 AC 70 ms
21,044 KB
testcase_05 AC 69 ms
21,116 KB
testcase_06 AC 71 ms
22,996 KB
testcase_07 AC 70 ms
22,936 KB
testcase_08 AC 69 ms
21,060 KB
testcase_09 AC 69 ms
22,876 KB
testcase_10 AC 72 ms
21,216 KB
testcase_11 AC 68 ms
22,992 KB
testcase_12 AC 69 ms
19,064 KB
testcase_13 AC 70 ms
21,128 KB
testcase_14 AC 58 ms
22,768 KB
testcase_15 AC 65 ms
22,820 KB
testcase_16 AC 68 ms
19,088 KB
testcase_17 AC 70 ms
21,264 KB
testcase_18 AC 69 ms
21,236 KB
testcase_19 AC 68 ms
21,220 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 57 ms
20,684 KB
testcase_24 AC 65 ms
22,776 KB
testcase_25 AC 65 ms
20,836 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 AC 56 ms
22,632 KB
testcase_29 AC 67 ms
21,020 KB
testcase_30 AC 66 ms
20,832 KB
testcase_31 AC 55 ms
22,736 KB
testcase_32 AC 55 ms
18,544 KB
testcase_33 AC 59 ms
20,692 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(' ');
            if (str.Length == 1)
                Console.WriteLine(1);
            else
            {
                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