結果
問題 | No.355 数当てゲーム(2) |
ユーザー | paruki |
提出日時 | 2016-06-20 16:40:08 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 1,598 bytes |
コンパイル時間 | 3,001 ms |
コンパイル使用メモリ | 168,608 KB |
実行使用メモリ | 24,432 KB |
平均クエリ数 | 24.81 |
最終ジャッジ日時 | 2023-09-24 00:09:30 |
合計ジャッジ時間 | 5,965 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 28 ms
24,084 KB |
testcase_01 | AC | 26 ms
24,060 KB |
testcase_02 | AC | 26 ms
24,024 KB |
testcase_03 | AC | 26 ms
23,448 KB |
testcase_04 | AC | 26 ms
24,408 KB |
testcase_05 | AC | 25 ms
24,036 KB |
testcase_06 | AC | 26 ms
23,568 KB |
testcase_07 | AC | 26 ms
24,432 KB |
testcase_08 | AC | 26 ms
24,348 KB |
testcase_09 | AC | 26 ms
23,664 KB |
testcase_10 | AC | 26 ms
23,412 KB |
testcase_11 | AC | 27 ms
23,676 KB |
testcase_12 | AC | 26 ms
24,336 KB |
testcase_13 | AC | 26 ms
24,036 KB |
testcase_14 | AC | 25 ms
23,868 KB |
testcase_15 | AC | 29 ms
24,048 KB |
testcase_16 | AC | 26 ms
24,324 KB |
testcase_17 | AC | 26 ms
23,436 KB |
testcase_18 | AC | 26 ms
23,424 KB |
testcase_19 | AC | 26 ms
23,424 KB |
testcase_20 | AC | 26 ms
23,448 KB |
testcase_21 | AC | 26 ms
23,664 KB |
testcase_22 | AC | 26 ms
24,096 KB |
testcase_23 | AC | 26 ms
23,988 KB |
testcase_24 | AC | 26 ms
23,676 KB |
testcase_25 | AC | 26 ms
24,264 KB |
testcase_26 | AC | 27 ms
24,300 KB |
testcase_27 | AC | 26 ms
23,448 KB |
testcase_28 | AC | 27 ms
23,424 KB |
testcase_29 | AC | 26 ms
23,688 KB |
testcase_30 | AC | 26 ms
24,240 KB |
testcase_31 | AC | 26 ms
23,448 KB |
testcase_32 | AC | 27 ms
23,460 KB |
testcase_33 | AC | 26 ms
24,048 KB |
testcase_34 | AC | 27 ms
23,664 KB |
testcase_35 | AC | 25 ms
23,580 KB |
testcase_36 | AC | 26 ms
24,036 KB |
testcase_37 | AC | 26 ms
24,036 KB |
testcase_38 | AC | 26 ms
24,324 KB |
testcase_39 | AC | 26 ms
24,048 KB |
testcase_40 | AC | 26 ms
23,580 KB |
testcase_41 | AC | 27 ms
23,412 KB |
testcase_42 | AC | 26 ms
24,240 KB |
testcase_43 | AC | 26 ms
23,676 KB |
testcase_44 | AC | 26 ms
24,084 KB |
testcase_45 | AC | 26 ms
24,048 KB |
testcase_46 | AC | 25 ms
23,448 KB |
testcase_47 | AC | 25 ms
24,036 KB |
testcase_48 | AC | 27 ms
23,568 KB |
testcase_49 | AC | 25 ms
23,700 KB |
testcase_50 | AC | 26 ms
23,688 KB |
testcase_51 | AC | 24 ms
23,436 KB |
ソースコード
#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)<<endl #define smax(x,y) (x)=max((x),(y)) #define smin(x,y) (x)=min((x),(y)) #define MEM(x,y) memset((x),(y),sizeof (x)) #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<ll> vll; int main(){ vi ans(4); ans[0] = 0, ans[1] = 1, ans[2] = 2, ans[3] = 3; int hit = -1, x, y; printf("%d %d %d %d\n", ans[0], ans[1], ans[2], ans[3]); fflush(stdout); scanf("%d %d", &x, &y); if(x == 4)return 0; hit = x + y; rep(i, 4){ rep(j, 10){ int uni = 1; rep(k, 4)if(i!=k && j == ans[k])uni = 0; if(uni){ int tmp = ans[i]; ans[i] = j; printf("%d %d %d %d\n", ans[0], ans[1], ans[2], ans[3]); fflush(stdout); scanf("%d %d", &x, &y); if(x == 4)return 0; if(x + y > hit){ hit = x + y; break; } else if(x + y < hit){ ans[i] = tmp; break; } } } } sort(all(ans)); do{ printf("%d %d %d %d\n", ans[0], ans[1], ans[2], ans[3]); fflush(stdout); scanf("%d %d", &x, &y); if(x == 4)break; } while(next_permutation(all(ans))); }