結果
問題 | No.394 ハーフパイプ(1) |
ユーザー |
|
提出日時 | 2016-07-15 22:50:52 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 1,458 bytes |
コンパイル時間 | 2,030 ms |
コンパイル使用メモリ | 110,880 KB |
実行使用メモリ | 26,852 KB |
最終ジャッジ日時 | 2024-10-15 04:39:08 |
合計ジャッジ時間 | 2,885 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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; } } }