結果

問題 No.394 ハーフパイプ(1)
ユーザー claw88claw88
提出日時 2016-07-15 22:42:10
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,325 bytes
コンパイル時間 787 ms
コンパイル使用メモリ 110,628 KB
実行使用メモリ 29,228 KB
最終ジャッジ日時 2024-04-23 04:55:09
合計ジャッジ時間 1,752 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
24,688 KB
testcase_01 AC 24 ms
24,880 KB
testcase_02 AC 25 ms
24,904 KB
testcase_03 AC 25 ms
24,944 KB
testcase_04 AC 26 ms
24,764 KB
testcase_05 AC 26 ms
25,032 KB
testcase_06 AC 26 ms
24,880 KB
testcase_07 AC 26 ms
24,884 KB
testcase_08 WA -
testcase_09 AC 24 ms
24,816 KB
testcase_10 AC 22 ms
22,196 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 yuki0715_A
{
    class Program
    {
        static void Main(string[] args)
        {
            var x = getsplit();
            var A = Array.ConvertAll(x, int.Parse);
            int max = -1;
            int min = 101;
            int maxm = -1;
            int minm = -1;
            for (int i = 0; i < A.Length; i++)
            {
                if (A[i]>max)
                {
                    max = A[i];
                    maxm = i;
                }
                if (A[i]<min)
                {
                    min = A[i];
                    minm = i;
                }
            }
            int sum = 0;
            for (int i = 0; i < A.Length; i++)
            {
                if (i!=minm && i!= maxm)
                {
                    sum += A[i];
                }
            }
            double ans = (double)sum / 4;
            Console.WriteLine(ans.ToString("f2"));
        }
        public static string[] getsplit()
        {
            string[] x = Console.ReadLine().Split(' ');
            return x;
        }
        public static int getint()
        {
            int x = int.Parse(Console.ReadLine());
            return x;
        }
    }
}
0