結果
問題 | No.246 質問と回答 |
ユーザー |
![]() |
提出日時 | 2015-07-29 09:49:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 64 ms / 2,000 ms |
コード長 | 690 bytes |
コンパイル時間 | 958 ms |
コンパイル使用メモリ | 83,080 KB |
実行使用メモリ | 25,220 KB |
平均クエリ数 | 101.00 |
最終ジャッジ日時 | 2024-07-16 19:52:05 |
合計ジャッジ時間 | 4,237 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:33:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 33 | scanf("%d", &y); | ~~~~~^~~~~~~~~~
ソースコード
#include <algorithm>#include <vector>#include <cfloat>#include <string>#include <cmath>#include <set>#include <cstdlib>#include <map>#include <ctime>#include <iomanip>#include <functional>#include <deque>#include <iostream>#include <cstring>#include <queue>#include <cstdio>#include <stack>#include <climits>#include <sys/time.h>#include <cctype>using namespace std;typedef long long ll;int main() {int l = 0, r = 1000000000;for (int i = 0; i < 100; i++) {int p = (l+r)/2;printf("? %d\n", p);fflush(stdout);int y;scanf("%d", &y);if (y) {l = p;}else {r = p;}}printf("! %d\n", l);fflush(stdout);}