結果

問題 No.156 キャンディー・ボックス
ユーザー NoNo
提出日時 2015-04-22 19:50:23
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 896 bytes
コンパイル時間 2,085 ms
コンパイル使用メモリ 100,844 KB
実行使用メモリ 25,740 KB
最終ジャッジ日時 2023-09-18 08:21:06
合計ジャッジ時間 5,734 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
23,712 KB
testcase_01 WA -
testcase_02 AC 63 ms
21,596 KB
testcase_03 AC 64 ms
23,688 KB
testcase_04 AC 63 ms
19,772 KB
testcase_05 WA -
testcase_06 AC 65 ms
21,764 KB
testcase_07 AC 65 ms
21,728 KB
testcase_08 AC 64 ms
23,820 KB
testcase_09 AC 65 ms
19,816 KB
testcase_10 AC 64 ms
21,804 KB
testcase_11 AC 63 ms
21,720 KB
testcase_12 AC 65 ms
21,584 KB
testcase_13 AC 64 ms
21,768 KB
testcase_14 AC 64 ms
21,816 KB
testcase_15 AC 66 ms
21,728 KB
testcase_16 AC 64 ms
21,720 KB
testcase_17 AC 65 ms
21,736 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 63 ms
23,788 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 62 ms
23,700 KB
testcase_25 AC 62 ms
21,688 KB
testcase_26 AC 63 ms
23,692 KB
testcase_27 AC 63 ms
23,804 KB
testcase_28 WA -
testcase_29 AC 63 ms
21,760 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 100 ms
21,800 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] = C[i] - 1;
                    M = M - 1;

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

            Console.WriteLine(cnt);
        }
    }
}
0