結果

問題 No.5 数字のブロック
ユーザー ototonariototonari
提出日時 2017-03-16 18:15:13
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 72 ms / 5,000 ms
コード長 908 bytes
コンパイル時間 5,902 ms
コンパイル使用メモリ 101,040 KB
実行使用メモリ 23,380 KB
最終ジャッジ日時 2023-08-11 17:11:38
合計ジャッジ時間 6,285 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
20,848 KB
testcase_01 AC 61 ms
22,820 KB
testcase_02 AC 57 ms
22,700 KB
testcase_03 AC 72 ms
23,220 KB
testcase_04 AC 69 ms
21,168 KB
testcase_05 AC 70 ms
21,320 KB
testcase_06 AC 71 ms
23,144 KB
testcase_07 AC 69 ms
23,260 KB
testcase_08 AC 69 ms
21,252 KB
testcase_09 AC 69 ms
23,144 KB
testcase_10 AC 71 ms
21,304 KB
testcase_11 AC 71 ms
23,380 KB
testcase_12 AC 71 ms
21,300 KB
testcase_13 AC 70 ms
23,348 KB
testcase_14 AC 59 ms
20,784 KB
testcase_15 AC 67 ms
20,984 KB
testcase_16 AC 69 ms
21,304 KB
testcase_17 AC 70 ms
23,356 KB
testcase_18 AC 70 ms
21,260 KB
testcase_19 AC 71 ms
19,480 KB
testcase_20 AC 60 ms
20,796 KB
testcase_21 AC 60 ms
22,952 KB
testcase_22 AC 60 ms
20,804 KB
testcase_23 AC 60 ms
20,912 KB
testcase_24 AC 67 ms
23,000 KB
testcase_25 AC 68 ms
21,072 KB
testcase_26 AC 61 ms
20,820 KB
testcase_27 AC 60 ms
20,760 KB
testcase_28 AC 58 ms
20,628 KB
testcase_29 AC 68 ms
21,164 KB
testcase_30 AC 68 ms
23,076 KB
testcase_31 AC 57 ms
20,740 KB
testcase_32 AC 57 ms
22,844 KB
testcase_33 AC 57 ms
20,680 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 yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int L = int.Parse(Console.ReadLine());
            int[] N = new int[int.Parse(Console.ReadLine())];
            string s = Console.ReadLine();
            string[] t = s.Split(' ');
            int c = 0;

            for(int i = 0;i < N.Length; i++)
            {
                N[i] = int.Parse(t[i]);
            }
            Array.Sort(N);


            for(int i =0;i < N.Length; i++)
            {
                if(0 <= (L - N[i]))
                {
                    c++;
                }
                L -= N[i];
            }

            Console.WriteLine("{0}", c);
            //Console.ReadLine();

        }
    }
}
0