結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-29 15:34:12 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 391 bytes |
| 記録 | |
| コンパイル時間 | 2,625 ms |
| コンパイル使用メモリ | 105,752 KB |
| 実行使用メモリ | 42,928 KB |
| 平均クエリ数 | 79.90 |
| 最終ジャッジ日時 | 2024-07-16 10:56:54 |
| 合計ジャッジ時間 | 5,393 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 9 RE * 21 |
コンパイルメッセージ
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 = (min + max) / 2; min != max; mid = (min + max) / 2)
{
Console.WriteLine("? {0}", mid);
bool isLess = int.Parse(Console.ReadLine()) == 0;
if (isLess)
{
max = mid - 1;
}
else
{
min = mid;
}
}
Console.WriteLine(mid);
}
}