結果

問題 No.91 赤、緑、青の石
ユーザー nanophoto12nanophoto12
提出日時 2014-12-10 00:55:52
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,098 bytes
コンパイル時間 2,664 ms
コンパイル使用メモリ 102,024 KB
実行使用メモリ 24,092 KB
最終ジャッジ日時 2023-09-02 12:27:14
合計ジャッジ時間 5,804 ms
ジャッジサーバーID
(参考情報)
judge16 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
23,900 KB
testcase_01 AC 60 ms
21,776 KB
testcase_02 AC 61 ms
21,984 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 62 ms
19,892 KB
testcase_07 AC 59 ms
19,788 KB
testcase_08 AC 58 ms
21,860 KB
testcase_09 WA -
testcase_10 AC 55 ms
21,852 KB
testcase_11 AC 58 ms
21,848 KB
testcase_12 AC 59 ms
21,788 KB
testcase_13 AC 61 ms
21,912 KB
testcase_14 AC 61 ms
21,800 KB
testcase_15 AC 60 ms
23,768 KB
testcase_16 AC 59 ms
21,840 KB
testcase_17 AC 58 ms
21,840 KB
testcase_18 AC 58 ms
23,988 KB
testcase_19 AC 60 ms
23,948 KB
testcase_20 AC 58 ms
21,864 KB
testcase_21 AC 58 ms
21,928 KB
testcase_22 AC 59 ms
19,892 KB
testcase_23 AC 59 ms
21,864 KB
testcase_24 AC 58 ms
21,932 KB
testcase_25 AC 59 ms
21,852 KB
testcase_26 WA -
testcase_27 AC 59 ms
21,840 KB
testcase_28 AC 59 ms
23,772 KB
testcase_29 AC 58 ms
23,884 KB
testcase_30 AC 56 ms
21,960 KB
testcase_31 AC 59 ms
21,776 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;

namespace Yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var right = line.Max();
            var left = line.Min();
            while (right - left > 1)
            {
                var mid = (right + left)/2;
                var sum = 0;
                for (int i = 0; i < line.Length; i++)
                {
                    if (line[i] >= mid)
                    {
                        sum += line[i] - mid;
                    }
                    else
                    {
                        sum -= (mid - line[i])*2;
                    }
                }
                if (sum >= 0)
                {
                    left = mid;
                }
                else
                {
                    right = mid;
                }
            }
            Console.WriteLine(left);
        }
    }
}
0