結果
問題 | No.594 壊れた宝物発見機 |
ユーザー | aaaaa |
提出日時 | 2017-11-10 23:45:34 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 111 ms / 2,000 ms |
コード長 | 1,471 bytes |
コンパイル時間 | 555 ms |
コンパイル使用メモリ | 68,912 KB |
実行使用メモリ | 24,396 KB |
平均クエリ数 | 31.65 |
最終ジャッジ日時 | 2023-09-23 14:58:29 |
合計ジャッジ時間 | 4,050 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 111 ms
23,376 KB |
testcase_01 | AC | 107 ms
24,048 KB |
testcase_02 | AC | 105 ms
23,892 KB |
testcase_03 | AC | 107 ms
24,396 KB |
testcase_04 | AC | 107 ms
23,676 KB |
testcase_05 | AC | 105 ms
24,048 KB |
testcase_06 | AC | 105 ms
23,652 KB |
testcase_07 | AC | 108 ms
24,348 KB |
testcase_08 | AC | 106 ms
24,012 KB |
testcase_09 | AC | 106 ms
24,048 KB |
testcase_10 | AC | 105 ms
23,628 KB |
testcase_11 | AC | 106 ms
23,244 KB |
testcase_12 | AC | 105 ms
24,012 KB |
testcase_13 | AC | 105 ms
24,348 KB |
testcase_14 | AC | 104 ms
23,424 KB |
testcase_15 | AC | 103 ms
24,048 KB |
testcase_16 | AC | 106 ms
24,384 KB |
testcase_17 | AC | 104 ms
23,544 KB |
testcase_18 | AC | 106 ms
23,628 KB |
testcase_19 | AC | 105 ms
23,376 KB |
ソースコード
#include <iostream> #include <stdio.h> #include <cstring> #include <math.h> #include <algorithm> #include <vector> #include <string> #include <stdlib.h> #include <queue> #include <stack> #include <utility> #include <fstream> #define rep(i,n) for(int i=0;i<n;i++) #define rrep(i,n) for(int i=n-1;i>=0;i--) #define FOR(i,a,b) for(int i=a;i<b;i++) #define ll long long #define INF 1000000001 #define mod 1000000007 #define p pair<int,int> int dx[4]={0,1,0,-1}; int dy[4]={1,0,-1,0}; using namespace std; int main(){ int x,y,z; int x2,y2,z2; x=150,y=0,z=0; x2=-150,y2=0,z2=0; int d1,d2; printf("? %d %d %d\n",x,y,z); cin>>d1; while(1){ printf("? %d %d %d\n",x2,y2,z2); cin>>d2; if(max(x-x2,x2-x)==1){ if(d1>d2){ x=x2; } break; } if(d1<d2){ x2=(x+x2)/2; }else{ d1=d2; int save=x; x=x2; x2=(save+x2)/2; } } x2=x; y=150; y2=-150; printf("? %d %d %d\n",x,y,z); cin>>d1; while(1){ printf("? %d %d %d\n",x2,y2,z2); cin>>d2; if(max(y-y2,y2-y)==1){ if(d1>d2){ y=y2; } break; } if(d1<d2){ y2=(y+y2)/2; }else{ d1=d2; int save=y; y=y2; y2=(save+y2)/2; } } y2=y; z=150; z2=-150; printf("? %d %d %d\n",x,y,z); cin>>d1; while(1){ printf("? %d %d %d\n",x2,y2,z2); cin>>d2; if(max(z-z2,z2-z)==1){ if(d1>d2){ z=z2; } break; } if(d1<d2){ z2=(z+z2)/2; }else{ d1=d2; int save=z; z=z2; z2=(save+z2)/2; } } printf("! %d %d %d\n",x,y,z); }