結果
問題 | No.514 宝探し3 |
ユーザー |
![]() |
提出日時 | 2017-05-05 22:23:51 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 22 ms / 2,000 ms |
コード長 | 663 bytes |
コンパイル時間 | 1,354 ms |
コンパイル使用メモリ | 156,952 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 2.75 |
最終ジャッジ日時 | 2024-07-16 12:52:36 |
合計ジャッジ時間 | 2,507 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘int query(int, int)’: main.cpp:6:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&x); | ~~~~~^~~~~~~~~
ソースコード
#include<bits/stdc++.h>using namespace std;int query(int x, int y){printf("%d %d\n",x,y);fflush(stdout);scanf("%d",&x);return x;}int main(){int i, j, k, m, x, y;k = query(0, 0);if(k==0){return 0;}m = query(0, k);if(m==0){return 0;}query(m/2, k-m/2);return 0;}// cLay varsion 20170505-3// --- original code ---// int query(int x, int y){// printf("%d %d\n",x,y);// fflush(stdout);// scanf("%d",&x);// return x;// }//// {// int i, j, k, m;// int x, y;//// k = query(0, 0);// if(k==0) return 0;//// m = query(0, k);// if(m==0) return 0;//// query(m/2, k-m/2);// }