結果

問題 No.5 数字のブロック
ユーザー huffman56huffman56
提出日時 2022-04-16 11:38:40
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 913 bytes
コンパイル時間 3,850 ms
コンパイル使用メモリ 106,152 KB
実行使用メモリ 25,660 KB
最終ジャッジ日時 2023-08-26 17:04:09
合計ジャッジ時間 5,373 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
21,628 KB
testcase_01 AC 56 ms
23,800 KB
testcase_02 WA -
testcase_03 AC 64 ms
22,140 KB
testcase_04 AC 61 ms
21,920 KB
testcase_05 AC 64 ms
22,112 KB
testcase_06 AC 65 ms
24,112 KB
testcase_07 AC 65 ms
22,008 KB
testcase_08 AC 66 ms
24,164 KB
testcase_09 AC 64 ms
22,072 KB
testcase_10 AC 66 ms
22,208 KB
testcase_11 AC 66 ms
24,032 KB
testcase_12 AC 68 ms
22,108 KB
testcase_13 AC 68 ms
20,104 KB
testcase_14 AC 55 ms
21,760 KB
testcase_15 AC 63 ms
23,752 KB
testcase_16 AC 65 ms
22,172 KB
testcase_17 AC 68 ms
22,228 KB
testcase_18 AC 68 ms
22,260 KB
testcase_19 AC 65 ms
24,284 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 56 ms
23,708 KB
testcase_24 AC 68 ms
21,772 KB
testcase_25 AC 65 ms
21,852 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 66 ms
22,088 KB
testcase_30 AC 68 ms
22,024 KB
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.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
using static System.Console;


namespace yukicoder
{
    class Program
    {
        static void Main()
        {
            int L = int.Parse(Console.ReadLine());
            int N = int.Parse(Console.ReadLine());
            int[] W = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Array.Sort(W);
            int n = 0;
            int cnt = 0;

            for (int i = 0; i < N; i++)
            {
                n += W[i];

                if (n > L)
                {
                    Console.WriteLine(cnt);
                    break;
                }

                cnt++;
            }
        }
    }
}
0