結果

問題 No.5 数字のブロック
ユーザー santasanta
提出日時 2020-07-25 21:56:55
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 874 bytes
コンパイル時間 4,959 ms
コンパイル使用メモリ 103,400 KB
実行使用メモリ 24,696 KB
最終ジャッジ日時 2023-09-10 00:49:37
合計ジャッジ時間 10,241 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
23,856 KB
testcase_01 AC 64 ms
21,904 KB
testcase_02 AC 64 ms
21,948 KB
testcase_03 AC 77 ms
22,340 KB
testcase_04 AC 77 ms
24,280 KB
testcase_05 AC 77 ms
22,368 KB
testcase_06 AC 75 ms
20,232 KB
testcase_07 AC 76 ms
24,340 KB
testcase_08 AC 77 ms
22,440 KB
testcase_09 AC 74 ms
20,188 KB
testcase_10 AC 78 ms
22,468 KB
testcase_11 AC 76 ms
24,220 KB
testcase_12 AC 77 ms
22,340 KB
testcase_13 AC 79 ms
24,412 KB
testcase_14 AC 66 ms
21,904 KB
testcase_15 AC 72 ms
21,880 KB
testcase_16 AC 77 ms
22,376 KB
testcase_17 AC 80 ms
22,604 KB
testcase_18 AC 78 ms
22,412 KB
testcase_19 AC 80 ms
24,696 KB
testcase_20 RE -
testcase_21 AC 65 ms
21,868 KB
testcase_22 RE -
testcase_23 AC 65 ms
21,776 KB
testcase_24 AC 73 ms
21,892 KB
testcase_25 AC 72 ms
21,904 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 77 ms
22,284 KB
testcase_30 AC 76 ms
22,188 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var line1 = Console.ReadLine().Split(' ').Select(c => int.Parse(c)).ToArray();
            var line2 = Console.ReadLine().Split(' ').Select(c => int.Parse(c)).ToArray();
            var line3 = Console.ReadLine().Split(' ').Select(c => int.Parse(c)).ToArray();

            var l = line1[0];
            var n = line1[0];
            var w = line3.OrderBy(c => c).ToArray();

            int left = l;
            int i = 0;
            for (; i < n; i++)
            {
                left = left - w[i];
                if (left < 0)
                {
                    break;
                }
            }

            int result = i;

            //結果を表示
            Console.WriteLine(result);
        }
    }
}
0