結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
Bantako
|
| 提出日時 | 2017-07-26 11:15:56 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 355 bytes |
| 記録 | |
| コンパイル時間 | 933 ms |
| コンパイル使用メモリ | 172,720 KB |
| 実行使用メモリ | 28,708 KB |
| 平均クエリ数 | 30.87 |
| 最終ジャッジ日時 | 2026-03-31 09:29:54 |
| 合計ジャッジ時間 | 5,783 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
コンパイルメッセージ
main.cpp:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){
| ^~~~
ソースコード
#include<bits/stdc++.h>
main(){
int min = 0,max = 1000000000;
while(min!=max){
printf("? %d\n",(min+max+1)/2);
fflush(stdout);
int ans;
scanf("%d",&ans);
if(ans){
min = (min+max+1)/2;
}else{
max = (min+max-1)/2;
}
}
printf("! %d\n",min);
fflush(stdout);
}
Bantako