結果
| 問題 |
No.246 質問と回答
|
| コンテスト | |
| ユーザー |
akakimidori
|
| 提出日時 | 2015-07-17 22:35:00 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 201 bytes |
| コンパイル時間 | 657 ms |
| コンパイル使用メモリ | 20,096 KB |
| 実行使用メモリ | 41,476 KB |
| 最終ジャッジ日時 | 2024-07-16 19:39:40 |
| 合計ジャッジ時間 | 6,966 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 29 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d",&ans);
| ^~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main(void){
int x=1;
int y=1000000000;
while(x<y){
int m=(x+y)/2;
printf("? %d\n",m);
int ans;
scanf("%d",&ans);
if(ans){
x=m;
} else {
y=m;
}
}
printf("! %d\n",x);
return 0;
}
akakimidori