結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
shimashimau67
|
| 提出日時 | 2015-08-01 14:05:18 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 908 bytes |
| 記録 | |
| コンパイル時間 | 2,159 ms |
| コンパイル使用メモリ | 110,820 KB |
| 実行使用メモリ | 42,648 KB |
| 平均クエリ数 | 45.30 |
| 最終ジャッジ日時 | 2024-07-16 07:17:14 |
| 合計ジャッジ時間 | 6,150 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 30 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
class Program
{
static void Main(string[] args)
{
//出力は
int max = 1000000000;
int b = max / 2;
int ask = max / 2;
for (int i = 0; i < 100; i++)
{
Console.WriteLine("? " + ask);
b /= 2;
if (int.Parse(Console.ReadLine()) == 1)
{
ask += b;
}
else
{
ask -= b;
}
if (b == 0)
{
ask -= 13;
while (true)
{
Console.WriteLine("? " + ask);
if (int.Parse(Console.ReadLine()) == 1) ask++;
else
{
Console.WriteLine("! " + (ask - 1));
break;
}
}
}
}
}
}
shimashimau67