結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
Bantako
|
| 提出日時 | 2017-07-26 10:58:49 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 352 bytes |
| 記録 | |
| コンパイル時間 | 901 ms |
| コンパイル使用メモリ | 172,704 KB |
| 実行使用メモリ | 39,588 KB |
| 平均クエリ数 | 2.70 |
| 最終ジャッジ日時 | 2026-03-31 09:30:36 |
| 合計ジャッジ時間 | 4,795 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 TLE * 1 -- * 26 |
コンパイルメッセージ
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 = 100000000;
while(min!=max){
printf("? %d\n",(min+max)/2);
fflush(stdout);
int ans;
scanf("%d",&ans);
if(ans){
min = (min+max)/2+1;
}else{
max = (min+max)/2-1;
}
}
printf("! %d\n",min);
fflush(stdout);
}
Bantako