結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
kenji_shioya
|
| 提出日時 | 2016-06-16 21:31:00 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 518 bytes |
| 記録 | |
| コンパイル時間 | 3,297 ms |
| コンパイル使用メモリ | 83,148 KB |
| 実行使用メモリ | 62,832 KB |
| 平均クエリ数 | 29.37 |
| 最終ジャッジ日時 | 2026-03-30 22:27:59 |
| 合計ジャッジ時間 | 7,652 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 26 |
ソースコード
import java.util.*;
public class Exercise90{
public static void main (String[] args){
Scanner sc = new Scanner(System.in);
int head = 1;
int tail = 1000000000;
int center = 0;
while(tail - head > 1){
center = (tail - head) / 2 + head;
System.out.println("? " + center);
System.out.flush();
int answer = sc.nextInt();
if(answer == 0){
tail = center - 2;
}else{
head = center + 1;
}
}
System.out.println("! " + center);
}
}
kenji_shioya