結果

問題 No.5 数字のブロック
ユーザー arasabakiarasabaki
提出日時 2016-03-08 23:00:06
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 615 bytes
コンパイル時間 3,543 ms
コンパイル使用メモリ 106,652 KB
実行使用メモリ 24,448 KB
最終ジャッジ日時 2023-08-11 14:46:48
合計ジャッジ時間 6,564 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,756 KB
testcase_01 AC 62 ms
23,752 KB
testcase_02 AC 58 ms
21,916 KB
testcase_03 AC 72 ms
22,292 KB
testcase_04 AC 72 ms
22,128 KB
testcase_05 AC 73 ms
22,432 KB
testcase_06 AC 72 ms
24,160 KB
testcase_07 AC 70 ms
22,196 KB
testcase_08 AC 70 ms
22,216 KB
testcase_09 AC 71 ms
24,080 KB
testcase_10 AC 76 ms
24,448 KB
testcase_11 AC 71 ms
24,308 KB
testcase_12 AC 73 ms
22,364 KB
testcase_13 AC 75 ms
24,252 KB
testcase_14 AC 63 ms
21,808 KB
testcase_15 AC 67 ms
19,820 KB
testcase_16 AC 74 ms
22,340 KB
testcase_17 AC 74 ms
22,372 KB
testcase_18 AC 74 ms
22,452 KB
testcase_19 AC 74 ms
22,592 KB
testcase_20 AC 63 ms
23,636 KB
testcase_21 AC 62 ms
21,708 KB
testcase_22 AC 60 ms
21,780 KB
testcase_23 AC 61 ms
21,688 KB
testcase_24 AC 70 ms
23,936 KB
testcase_25 AC 69 ms
21,888 KB
testcase_26 AC 62 ms
23,716 KB
testcase_27 AC 60 ms
21,684 KB
testcase_28 AC 60 ms
23,816 KB
testcase_29 AC 71 ms
22,120 KB
testcase_30 AC 68 ms
24,036 KB
testcase_31 AC 64 ms
19,796 KB
testcase_32 AC 62 ms
23,756 KB
testcase_33 AC 61 ms
21,688 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;

namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var width = int.Parse(Console.ReadLine());
            Console.ReadLine();
            var blocks = Console.ReadLine().Split().Select(i => int.Parse(i)).OrderBy(i=>i);

            int count = 0;
            foreach (var item in blocks)
            {
                width -= item;
                if (width < 0)
                {
                    break;
                }
                count++;
            }
            Console.WriteLine(count);
        }
    }
}
0