結果
問題 | No.594 壊れた宝物発見機 |
ユーザー | kotamanegi |
提出日時 | 2017-11-10 23:03:59 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 102 ms / 2,000 ms |
コード長 | 2,617 bytes |
コンパイル時間 | 859 ms |
コンパイル使用メモリ | 106,660 KB |
実行使用メモリ | 24,396 KB |
平均クエリ数 | 86.10 |
最終ジャッジ日時 | 2023-09-23 14:49:50 |
合計ジャッジ時間 | 3,991 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 102 ms
23,484 KB |
testcase_01 | AC | 95 ms
24,264 KB |
testcase_02 | AC | 97 ms
24,396 KB |
testcase_03 | AC | 93 ms
24,324 KB |
testcase_04 | AC | 95 ms
23,580 KB |
testcase_05 | AC | 94 ms
23,784 KB |
testcase_06 | AC | 95 ms
23,952 KB |
testcase_07 | AC | 94 ms
24,312 KB |
testcase_08 | AC | 101 ms
23,928 KB |
testcase_09 | AC | 98 ms
24,312 KB |
testcase_10 | AC | 97 ms
23,772 KB |
testcase_11 | AC | 94 ms
24,192 KB |
testcase_12 | AC | 94 ms
24,192 KB |
testcase_13 | AC | 96 ms
23,340 KB |
testcase_14 | AC | 97 ms
23,568 KB |
testcase_15 | AC | 92 ms
23,688 KB |
testcase_16 | AC | 95 ms
23,940 KB |
testcase_17 | AC | 97 ms
23,424 KB |
testcase_18 | AC | 96 ms
23,460 KB |
testcase_19 | AC | 95 ms
24,276 KB |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #include <iostream> #include <random> #include<map> #include <iomanip> #include <time.h> #include <stdlib.h> #include <list> #include <typeinfo> #include <list> #include <set> #include <cassert> #include<fstream> #include <unordered_map> #include <cstdlib> using namespace std; #define Ma_PI 3.141592653589793 #define eps 0.00000001 #define LONG_INF 3000000000000000000 #define GOLD 1.61803398874989484820458 #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) #define seg_size 524288 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #include <iostream> #include <random> #include<map> #include <iomanip> #include <time.h> #include <stdlib.h> #include <list> #include <typeinfo> #include <list> #include <set> #include <cassert> #include<fstream> #include <unordered_map> #include <cstdlib> using namespace std; #define Ma_PI 3.141592653589793 #define eps 0.00000001 #define LONG_INF 3000000000000000000 #define GOLD 1.61803398874989484820458 #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) #define seg_size 524288 int ans[3] = {}; int ask(int a, int c) { cout << "?"; if (c == 0) { cout << " " << a; } else { cout << " " << ans[0]; } if (c == 1) { cout << " " << a; } else cout << " " << ans[1]; if (c == 2) { cout << " " << a; } else cout << " " << ans[2]; cout << endl; int temp = 0; cin >> temp; return temp; } int main() { for (int i = 0;i < 3;++i) { int bot = -150; int top = 150; while (top - bot > 2) { int boto = (bot + bot + top) / 3; int topo = (bot + top + top) / 3; int getb = ask(boto, i), getc = ask(topo, i); if (getb < getc) { top = topo; } else { bot = boto; } } vector<pair<int, int>> wow; for (int q = bot;q <= top;++q) { int neko = ask(q, i); wow.push_back(make_pair(neko, q)); } sort(wow.begin(), wow.end()); ans[i] = wow[0].second; } cout << "! " << ans[0] << " " << ans[1] << " " << ans[2] << endl; return 0; }