結果

問題 No.5 数字のブロック
ユーザー KEIT0KEIT0
提出日時 2017-05-10 13:42:12
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 750 bytes
コンパイル時間 1,923 ms
コンパイル使用メモリ 99,708 KB
実行使用メモリ 23,300 KB
最終ジャッジ日時 2023-10-13 10:00:48
合計ジャッジ時間 5,704 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
18,660 KB
testcase_01 AC 60 ms
20,864 KB
testcase_02 WA -
testcase_03 AC 70 ms
21,204 KB
testcase_04 AC 71 ms
23,108 KB
testcase_05 WA -
testcase_06 AC 70 ms
21,352 KB
testcase_07 AC 68 ms
21,256 KB
testcase_08 AC 70 ms
21,316 KB
testcase_09 AC 65 ms
20,988 KB
testcase_10 AC 74 ms
21,504 KB
testcase_11 AC 72 ms
21,220 KB
testcase_12 AC 73 ms
21,252 KB
testcase_13 AC 73 ms
21,384 KB
testcase_14 AC 61 ms
22,708 KB
testcase_15 WA -
testcase_16 AC 70 ms
21,364 KB
testcase_17 AC 73 ms
21,432 KB
testcase_18 AC 72 ms
21,656 KB
testcase_19 AC 73 ms
19,408 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 57 ms
22,684 KB
testcase_24 AC 65 ms
21,016 KB
testcase_25 AC 66 ms
20,876 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
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;

class Class1
{
    static void Main()
    {
        //パターンのカウント
        int count = 0;
        int max = 0;

        //値の入力
        int bigbox = int.Parse(Console.ReadLine());
        int smallbox_height = int.Parse(Console.ReadLine());
        string[] small_boxs = Console.ReadLine().Split(' ');

        ArrayList List = new ArrayList();
        for(int i = 0;i<small_boxs.Length;i++) List.Add(int.Parse(small_boxs[i]));
        List.Sort();

        foreach(int i in List)
        {
            if(bigbox > max){
                max += (int)i;
                count++;
            }else{
                break;
            }
        }

        Console.WriteLine(count-1);
    }
}
0