結果

問題 No.5 数字のブロック
ユーザー mencottonmencotton
提出日時 2017-12-25 14:31:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 636 bytes
コンパイル時間 2,341 ms
コンパイル使用メモリ 102,448 KB
実行使用メモリ 24,260 KB
最終ジャッジ日時 2023-08-11 17:59:21
合計ジャッジ時間 6,304 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,652 KB
testcase_01 AC 60 ms
21,764 KB
testcase_02 AC 58 ms
23,676 KB
testcase_03 AC 68 ms
24,140 KB
testcase_04 AC 68 ms
22,044 KB
testcase_05 AC 71 ms
22,188 KB
testcase_06 AC 70 ms
22,020 KB
testcase_07 AC 69 ms
24,116 KB
testcase_08 AC 65 ms
22,120 KB
testcase_09 AC 67 ms
23,864 KB
testcase_10 AC 68 ms
24,260 KB
testcase_11 AC 65 ms
24,012 KB
testcase_12 AC 67 ms
22,072 KB
testcase_13 AC 71 ms
24,228 KB
testcase_14 AC 60 ms
21,740 KB
testcase_15 AC 65 ms
21,928 KB
testcase_16 AC 70 ms
24,176 KB
testcase_17 AC 71 ms
22,248 KB
testcase_18 AC 70 ms
20,108 KB
testcase_19 AC 70 ms
22,208 KB
testcase_20 AC 58 ms
21,588 KB
testcase_21 AC 57 ms
21,536 KB
testcase_22 AC 57 ms
21,856 KB
testcase_23 AC 58 ms
21,684 KB
testcase_24 AC 66 ms
21,800 KB
testcase_25 AC 67 ms
23,884 KB
testcase_26 AC 59 ms
19,600 KB
testcase_27 AC 57 ms
21,668 KB
testcase_28 AC 58 ms
23,680 KB
testcase_29 AC 75 ms
24,088 KB
testcase_30 AC 68 ms
23,992 KB
testcase_31 AC 57 ms
19,756 KB
testcase_32 AC 58 ms
21,876 KB
testcase_33 AC 55 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace template
{
    class Program
    {
        static void Main(string[] args)
        {
            int l = int.Parse(Console.ReadLine());
            int n = int.Parse(Console.ReadLine());
            int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Array.Sort(x); int sum = 0; int i;
            for (i = 0; i < n;)
            {
                sum += x[i];
                if (sum > l) break;
                i++;
            }
            Console.WriteLine(i);
        }
    }
}
0