結果

問題 No.394 ハーフパイプ(1)
ユーザー claw88claw88
提出日時 2016-07-15 22:50:52
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 1,458 bytes
コンパイル時間 2,715 ms
コンパイル使用メモリ 103,748 KB
実行使用メモリ 24,840 KB
最終ジャッジ日時 2023-08-05 06:57:07
合計ジャッジ時間 4,262 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
22,648 KB
testcase_01 AC 62 ms
22,696 KB
testcase_02 AC 63 ms
24,728 KB
testcase_03 AC 63 ms
20,688 KB
testcase_04 AC 62 ms
22,716 KB
testcase_05 AC 63 ms
22,792 KB
testcase_06 AC 63 ms
22,628 KB
testcase_07 AC 63 ms
22,660 KB
testcase_08 AC 63 ms
22,632 KB
testcase_09 AC 63 ms
24,840 KB
testcase_10 AC 61 ms
22,856 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 (minm == maxm)
                {
                    sum = A[i] * 4;
                    break;
                }
                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