結果

問題 No.156 キャンディー・ボックス
ユーザー NoNo
提出日時 2015-04-22 19:17:05
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 873 bytes
コンパイル時間 2,415 ms
コンパイル使用メモリ 102,128 KB
実行使用メモリ 23,788 KB
最終ジャッジ日時 2023-09-18 08:20:44
合計ジャッジ時間 5,942 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,568 KB
testcase_01 WA -
testcase_02 AC 63 ms
21,608 KB
testcase_03 AC 62 ms
21,764 KB
testcase_04 AC 62 ms
23,700 KB
testcase_05 WA -
testcase_06 AC 64 ms
23,752 KB
testcase_07 AC 64 ms
23,564 KB
testcase_08 AC 63 ms
21,652 KB
testcase_09 AC 62 ms
21,624 KB
testcase_10 AC 63 ms
19,700 KB
testcase_11 AC 63 ms
21,504 KB
testcase_12 AC 62 ms
19,632 KB
testcase_13 AC 63 ms
21,704 KB
testcase_14 AC 63 ms
19,820 KB
testcase_15 AC 63 ms
21,736 KB
testcase_16 AC 64 ms
21,656 KB
testcase_17 AC 64 ms
21,660 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 61 ms
21,572 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 60 ms
21,676 KB
testcase_25 AC 61 ms
21,764 KB
testcase_26 AC 62 ms
21,616 KB
testcase_27 AC 63 ms
21,736 KB
testcase_28 WA -
testcase_29 AC 62 ms
21,660 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 94 ms
21,668 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 ForYukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split();
            int N = int.Parse(str[0]);
            int M = int.Parse(str[1]);
            int[] C =  Console.ReadLine().Split().Select(int.Parse).ToArray<int>();
            //------------

            Array.Sort<int>(C);

            int cnt = 0;
            while (M > 0)
            {
                for (int i = cnt; i < N; i++)
                {
                    C[i]--;
                    M--;

                    if (C[i] == 0)
                    {
                        cnt++;
                    }
                }
            }

            Console.WriteLine(cnt);
        }
    }
}
0