結果

問題 No.91 赤、緑、青の石
ユーザー nanophoto12nanophoto12
提出日時 2014-12-10 01:00:21
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 62 ms / 5,000 ms
コード長 1,098 bytes
コンパイル時間 2,522 ms
コンパイル使用メモリ 104,936 KB
実行使用メモリ 23,928 KB
最終ジャッジ日時 2023-09-06 12:08:59
合計ジャッジ時間 5,885 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,832 KB
testcase_01 AC 60 ms
21,740 KB
testcase_02 AC 59 ms
21,992 KB
testcase_03 AC 59 ms
21,744 KB
testcase_04 AC 60 ms
23,844 KB
testcase_05 AC 59 ms
21,728 KB
testcase_06 AC 62 ms
23,776 KB
testcase_07 AC 60 ms
19,892 KB
testcase_08 AC 59 ms
21,928 KB
testcase_09 AC 59 ms
19,788 KB
testcase_10 AC 60 ms
21,916 KB
testcase_11 AC 59 ms
23,876 KB
testcase_12 AC 59 ms
21,684 KB
testcase_13 AC 60 ms
21,792 KB
testcase_14 AC 60 ms
23,772 KB
testcase_15 AC 59 ms
23,772 KB
testcase_16 AC 59 ms
21,836 KB
testcase_17 AC 58 ms
21,756 KB
testcase_18 AC 60 ms
21,728 KB
testcase_19 AC 59 ms
21,600 KB
testcase_20 AC 59 ms
23,804 KB
testcase_21 AC 59 ms
23,760 KB
testcase_22 AC 59 ms
23,908 KB
testcase_23 AC 59 ms
23,880 KB
testcase_24 AC 60 ms
21,748 KB
testcase_25 AC 59 ms
23,876 KB
testcase_26 AC 60 ms
23,876 KB
testcase_27 AC 59 ms
21,832 KB
testcase_28 AC 61 ms
21,800 KB
testcase_29 AC 60 ms
23,928 KB
testcase_30 AC 60 ms
21,804 KB
testcase_31 AC 62 ms
21,996 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)/2;
                    }
                    else
                    {
                        sum -= mid - line[i];
                    }
                }
                if (sum >= 0)
                {
                    left = mid;
                }
                else
                {
                    right = mid;
                }
            }
            Console.WriteLine(left);
        }
    }
}
0