結果
問題 | No.355 数当てゲーム(2) |
ユーザー | naimonon77 |
提出日時 | 2016-09-03 05:15:30 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,014 bytes |
コンパイル時間 | 2,098 ms |
コンパイル使用メモリ | 189,652 KB |
実行使用メモリ | 40,880 KB |
平均クエリ数 | 9.02 |
最終ジャッジ日時 | 2024-07-16 10:58:50 |
合計ジャッジ時間 | 7,622 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 21 ms
24,592 KB |
testcase_02 | AC | 21 ms
24,976 KB |
testcase_03 | AC | 20 ms
24,592 KB |
testcase_04 | AC | 20 ms
24,848 KB |
testcase_05 | AC | 20 ms
25,232 KB |
testcase_06 | AC | 21 ms
25,232 KB |
testcase_07 | AC | 22 ms
24,976 KB |
testcase_08 | AC | 21 ms
24,976 KB |
testcase_09 | AC | 22 ms
25,076 KB |
testcase_10 | AC | 21 ms
24,592 KB |
testcase_11 | AC | 21 ms
24,592 KB |
testcase_12 | AC | 21 ms
24,976 KB |
testcase_13 | AC | 22 ms
24,848 KB |
testcase_14 | WA | - |
testcase_15 | AC | 22 ms
25,360 KB |
testcase_16 | AC | 21 ms
25,232 KB |
testcase_17 | AC | 22 ms
25,220 KB |
testcase_18 | AC | 24 ms
25,228 KB |
testcase_19 | AC | 22 ms
25,232 KB |
testcase_20 | AC | 21 ms
24,952 KB |
testcase_21 | AC | 21 ms
25,208 KB |
testcase_22 | AC | 22 ms
24,952 KB |
testcase_23 | AC | 22 ms
25,208 KB |
testcase_24 | AC | 21 ms
25,208 KB |
testcase_25 | AC | 21 ms
25,592 KB |
testcase_26 | AC | 21 ms
25,288 KB |
testcase_27 | AC | 20 ms
24,952 KB |
testcase_28 | AC | 21 ms
24,568 KB |
testcase_29 | AC | 20 ms
24,568 KB |
testcase_30 | AC | 21 ms
25,592 KB |
testcase_31 | AC | 22 ms
24,556 KB |
testcase_32 | AC | 22 ms
25,292 KB |
testcase_33 | AC | 21 ms
25,208 KB |
testcase_34 | AC | 21 ms
25,208 KB |
testcase_35 | TLE | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
testcase_47 | -- | - |
testcase_48 | -- | - |
testcase_49 | -- | - |
testcase_50 | -- | - |
testcase_51 | -- | - |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include "bits/stdc++.h" #define REP(i,a,b) for(i=a;i<b;++i) #define rep(i,n) REP(i,0,n) #define ll long long #define ull unsigned ll typedef long double ld; #define ALL(a) begin(a),end(a) #define ifnot(a) if(not a) #define dump(x) cerr << #x << " = " << (x) << endl using namespace std; // #define int ll bool test = 0; int dx[] = { 0,1,0,-1 }; int dy[] = { 1,0,-1,0 }; #define INF (1 << 28) ull mod = (int)1e9 + 7; //..................... #define MAX (int)1e6 + 5 ll now_x, now_y; ll pre_x, pre_y; signed main(void) { ll i, j, k, l; srand(time(NULL)); map<int, int> status; set<int> pre_query = { 0,1,2,3 }; auto itr = pre_query.begin(); for(i=0;i<3;i++,itr++) cout << *itr << " "; cout << *itr << endl; cin >> pre_x >> pre_y; rep(i, 10) status[i] = 0; while (status.size() > 4) { int target = -1; int try_num; vector<int> target_vec; for (auto v : pre_query) { target_vec.push_back(v); } target = target_vec[rand() % target_vec.size()]; set<int> now_query = pre_query; now_query.erase(target); vector<int> o; for (auto a : status) { if (now_query.count(a.first) == 0) { o.push_back(a.first); } } try_num = o[rand() % o.size()]; now_query.insert(try_num); // random大丈夫? auto itr = now_query.begin(); for (i = 0; i<3; i++, itr++) cout << *itr << " "; cout << *itr << endl; cin >> now_x >> now_y; int diff = now_x + now_y - (pre_x + pre_y); if (diff < 0) { status.erase(try_num); status[target] = 1; } if (diff > 0) { status.erase(target); status[try_num] = 1; } pre_query = now_query; pre_x = now_x; pre_y = now_y; for (auto v : status) { fprintf(stderr,"status[%d] = %d\n", v.first, v.second); } } vector<int> query; for (auto a : status) query.push_back(a.first); do { rep(i, 3) cout << query[i] << " "; cout << query[i] << endl; cin >> now_x >> now_y; if (now_x == 4) break; } while (next_permutation(ALL(query))); }