結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー 吉田英陽吉田英陽
提出日時 2021-03-31 21:38:01
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,491 bytes
コンパイル時間 2,787 ms
コンパイル使用メモリ 105,856 KB
実行使用メモリ 30,720 KB
最終ジャッジ日時 2024-05-09 05:58:23
合計ジャッジ時間 4,573 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
24,448 KB
testcase_01 AC 25 ms
18,944 KB
testcase_02 AC 25 ms
18,688 KB
testcase_03 AC 26 ms
18,688 KB
testcase_04 AC 65 ms
28,032 KB
testcase_05 AC 26 ms
18,816 KB
testcase_06 AC 31 ms
19,456 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 ConsoleApp190
{
    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 x = int.Parse(str[2]);
            int y = int.Parse(str[3]);
            int nokori = n;
            int kesu = 0;
            long sum = 0;
            long[] a = new long[n];
            string[] str2 = Console.ReadLine().Split();
            for(int i = 0; i < n; i++)
            {
                a[i] = int.Parse(str2[i]);
            }
            for(int i = 0; i < n; i++)
            {
                if (a[i] <= y)
                {
                    nokori -= 1;
                    a[i] = 1000000;
                    kesu += 1;
                }
            }
            while (a.Min() < x&&nokori>m)
            {
                nokori -= 1;
                a[Array.IndexOf(a,a.Min())] = 1000000;
                kesu += 1;
            }
            if (nokori>m)
            {
                Console.WriteLine("Handicapped");
            }
            else
            {
                for(int i = 0; i < n; i++)
                {
                    sum += a[i];
                }
                Console.WriteLine(sum-(kesu*1000000));
            }
            Console.ReadLine();
        }
    }
}
0