結果

問題 No.394 ハーフパイプ(1)
ユーザー TaK7907TaK7907
提出日時 2017-10-27 07:29:29
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 1,332 bytes
コンパイル時間 776 ms
コンパイル使用メモリ 112,556 KB
実行使用メモリ 28,256 KB
最終ジャッジ日時 2024-05-01 15:37:13
合計ジャッジ時間 1,664 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
28,000 KB
testcase_01 AC 33 ms
26,028 KB
testcase_02 AC 33 ms
26,412 KB
testcase_03 AC 33 ms
26,204 KB
testcase_04 AC 32 ms
28,124 KB
testcase_05 AC 33 ms
25,948 KB
testcase_06 AC 33 ms
26,464 KB
testcase_07 AC 33 ms
26,332 KB
testcase_08 AC 33 ms
26,072 KB
testcase_09 AC 33 ms
28,256 KB
testcase_10 AC 32 ms
25,516 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;

namespace yukicodeX {
    public class Program {
        public static string Solver(System.IO.TextReader reader) {
            var s = MyLib.GetIntList( reader.ReadLine() ).OrderBy( x => x ).TakeLast( 5 ).Take( 4 ).Sum();
            return string.Format( "{0:f2}",  s  / 4.0 );
        }

        private static void Main() {
            Console.WriteLine( Solver( Console.In ) );
        }
    }

    public class MyLib {
        public static string Ordinalization(int num) {
            string surfix = "stndrdth";
            return string.Format( "{0}{1}", num,
                ( 0 < num % 10 && num % 10 <= 4 ) && ( ( num % 100 ) / 10 != 1 ) ?
                surfix.Substring( ( num % 10 - 1 ) * 2, 2 ) : surfix.Substring( 6 ) );
        }

        public static List<int> GetIntList(string input) {
            return input.Split().ToList<string>().ConvertAll<int>( int.Parse );
        }

        public static List<int> GetIntList(string input, char delimitor) {
            return input.Split( delimitor ).ToList<string>().ConvertAll<int>( int.Parse );
        }

        public static List<int> GetIntList(string input, char[] delimitors) {
            return input.Split( delimitors ).ToList<string>().ConvertAll<int>( int.Parse );
        }
    }
}
0