結果

問題 No.5 数字のブロック
ユーザー takosamatakosama
提出日時 2017-12-16 19:36:48
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 818 bytes
コンパイル時間 4,150 ms
コンパイル使用メモリ 104,256 KB
実行使用メモリ 24,288 KB
最終ジャッジ日時 2023-08-21 11:14:08
合計ジャッジ時間 8,122 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
21,564 KB
testcase_01 AC 63 ms
21,748 KB
testcase_02 WA -
testcase_03 AC 75 ms
24,212 KB
testcase_04 AC 73 ms
24,012 KB
testcase_05 WA -
testcase_06 AC 72 ms
22,036 KB
testcase_07 AC 72 ms
24,020 KB
testcase_08 AC 73 ms
22,028 KB
testcase_09 AC 70 ms
22,012 KB
testcase_10 AC 74 ms
22,108 KB
testcase_11 AC 70 ms
21,980 KB
testcase_12 AC 71 ms
22,220 KB
testcase_13 AC 71 ms
22,088 KB
testcase_14 AC 61 ms
21,732 KB
testcase_15 WA -
testcase_16 AC 74 ms
22,204 KB
testcase_17 AC 75 ms
24,288 KB
testcase_18 AC 71 ms
20,136 KB
testcase_19 AC 73 ms
24,200 KB
testcase_20 AC 60 ms
19,740 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 60 ms
21,604 KB
testcase_24 AC 67 ms
23,752 KB
testcase_25 AC 68 ms
21,756 KB
testcase_26 AC 61 ms
23,772 KB
testcase_27 AC 60 ms
21,676 KB
testcase_28 AC 59 ms
21,752 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 58 ms
21,744 KB
testcase_32 AC 58 ms
23,656 KB
testcase_33 AC 58 ms
21,740 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace yukicore
{
    class Program
    {

        static void Main(string[] args)
        {
            int boxSize = int.Parse(Console.ReadLine());
            Console.ReadLine();
            int[] blockSizes =
                Console.ReadLine()
                    .Split(' ')
                    .Select(x => int.Parse(x))
                    .ToArray();
            Array.Sort(blockSizes);
            int sum = 0;
            int cnt = 0;
            foreach (var blockSize in blockSizes)
            {
                sum += blockSize;
                if(sum>=boxSize)
                    break;
                    cnt++;
            }
            Console.WriteLine(cnt);
        }
    }
}
0