結果
問題 | No.246 質問と回答 |
ユーザー |
|
提出日時 | 2016-08-29 15:37:21 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 75 ms / 2,000 ms |
コード長 | 442 bytes |
コンパイル時間 | 2,750 ms |
コンパイル使用メモリ | 110,328 KB |
実行使用メモリ | 43,052 KB |
平均クエリ数 | 30.87 |
最終ジャッジ日時 | 2024-07-16 20:06:05 |
合計ジャッジ時間 | 4,555 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;public class Program{public static void Main(){int min = 0, max = (int)Math.Pow(10, 9);int mid;for (mid = (int)Math.Ceiling((min + max) / 2.0); min != max; mid = (int)Math.Ceiling((min + max) / 2.0)){Console.WriteLine("? {0}", mid);bool isLess = int.Parse(Console.ReadLine()) == 0;if (isLess){max = mid - 1;}else{min = mid;}}Console.WriteLine("! {0}", mid);}}