結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2015-07-17 23:18:40 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 314 bytes |
| 記録 | |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 21,700 KB |
| 最終ジャッジ日時 | 2026-02-23 18:49:15 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c:3:1: error: C++ style comments are not allowed in ISO C90
3 | //namaega184
| ^
main.c:3:1: note: (this will be reported only once per input file)
main.c: In function ‘main’:
main.c:13:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%d",&res);
| ^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
//namaega184
int main(){
int left=0,right=1000000000,mid=0;
while(left<right){
mid=(left+right)/2;
printf("? %d",mid);
fflush(stdout);
int res;
scanf("%d",&res);
if(res){
left=mid+1;
}
else{
right=mid-1;
}
}
printf("! %d",mid);
fflush(stdout);
return 0;
}
184