結果

問題 No.513 宝探し2
ユーザー vorg101vorg101
提出日時 2017-05-06 00:18:35
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,796 bytes
コンパイル時間 2,462 ms
コンパイル使用メモリ 106,152 KB
実行使用メモリ 39,088 KB
平均クエリ数 43.50
最終ジャッジ日時 2023-09-23 13:52:26
合計ジャッジ時間 6,132 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program
{
    private static readonly Scanner sc = new Scanner();
    // private static readonly int INF = 1010101010;
    static void Main(string[] args)
    {
        int x = 0;
        int y = 0;
        for (int i = 0; i < 2; i++)
        {
            int left = 0;
            int right = 100001;

            while(left + 1 < right)
            {
                int midl = (left + right * 2) / 3;
                int midr = (left * 2 + right) / 3;
                int dl, dr;

                if (i == 0)
                {
                    Console.WriteLine("{0} {1}", midl, y);
                    dl = sc.Int;
                    Console.WriteLine("{0} {1}", midr, y);
                    dr = sc.Int;
                }
                else
                {
                    Console.WriteLine("{0} {1}", x, midl);
                    dl = sc.Int;
                    Console.WriteLine("{0} {1}", x, midr);
                    dr = sc.Int;
                }
                
                if (dl < dr)
                    right = midr;
                else 
                    left = midl;
            }

            if (i == 0)
                x = left;
            else 
                y = left;
        }
        Console.WriteLine("{0} {1}", x, y);
    }
}

class Scanner
{
    private string[] _str = new string[0];
    private int _i;

    public string Str
    {
        get
        {
            if (_i >= _str.Length)
            {
                _str = Console.ReadLine().Split(' ');
                _i = 0;
            }
            return _str[_i++];
        }
    }

    public int Int { get { return int.Parse(Str); } }
    public long Long { get { return long.Parse(Str); } }
    public double Double { get { return double.Parse(Str); } }
}
0