結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
37zigen
|
| 提出日時 | 2016-03-22 17:58:16 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 560 bytes |
| 記録 | |
| コンパイル時間 | 1,585 ms |
| コンパイル使用メモリ | 83,548 KB |
| 実行使用メモリ | 62,768 KB |
| 平均クエリ数 | 31.53 |
| 最終ジャッジ日時 | 2026-03-30 21:34:28 |
| 合計ジャッジ時間 | 6,819 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 30 |
ソースコード
package yukicoder246;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int upper=(int)Math.pow(10, 9);
int low=0;
while(upper!=low){
int mid=(int)(upper+low)/2;
System.out.println("? "+mid);
int a=sc.nextInt();
if(a==1){
low=mid;
if(upper==low+1){
System.out.println("! "+upper);
sc.close();
return;
}
}else{
upper=mid;
if(upper==low){
System.out.println("! "+upper);
sc.close();
return;
}
}
}
}
}
37zigen