結果

問題 No.355 数当てゲーム(2)
ユーザー koyoprokoyopro
提出日時 2020-01-15 23:04:50
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 1,552 bytes
コンパイル時間 1,655 ms
コンパイル使用メモリ 144,076 KB
実行使用メモリ 24,384 KB
平均クエリ数 17.08
最終ジャッジ日時 2023-09-24 02:24:03
合計ジャッジ時間 5,196 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,436 KB
testcase_01 AC 25 ms
23,568 KB
testcase_02 AC 25 ms
23,412 KB
testcase_03 AC 25 ms
23,568 KB
testcase_04 AC 25 ms
23,640 KB
testcase_05 AC 26 ms
24,336 KB
testcase_06 AC 25 ms
23,424 KB
testcase_07 AC 24 ms
24,048 KB
testcase_08 AC 24 ms
23,856 KB
testcase_09 AC 24 ms
24,228 KB
testcase_10 AC 24 ms
23,940 KB
testcase_11 AC 24 ms
24,060 KB
testcase_12 AC 25 ms
24,036 KB
testcase_13 AC 25 ms
23,676 KB
testcase_14 AC 25 ms
23,676 KB
testcase_15 AC 26 ms
24,276 KB
testcase_16 AC 25 ms
23,640 KB
testcase_17 AC 25 ms
23,556 KB
testcase_18 AC 25 ms
24,024 KB
testcase_19 AC 26 ms
24,288 KB
testcase_20 AC 25 ms
24,276 KB
testcase_21 AC 25 ms
24,084 KB
testcase_22 AC 25 ms
23,652 KB
testcase_23 AC 26 ms
24,036 KB
testcase_24 AC 24 ms
24,264 KB
testcase_25 AC 23 ms
23,688 KB
testcase_26 AC 25 ms
23,376 KB
testcase_27 AC 25 ms
23,688 KB
testcase_28 AC 24 ms
24,348 KB
testcase_29 AC 24 ms
23,412 KB
testcase_30 AC 25 ms
23,664 KB
testcase_31 AC 24 ms
23,424 KB
testcase_32 AC 25 ms
24,036 KB
testcase_33 AC 25 ms
23,460 KB
testcase_34 AC 25 ms
24,300 KB
testcase_35 AC 24 ms
23,652 KB
testcase_36 AC 25 ms
24,024 KB
testcase_37 AC 24 ms
24,072 KB
testcase_38 AC 24 ms
23,664 KB
testcase_39 AC 25 ms
24,048 KB
testcase_40 AC 24 ms
24,012 KB
testcase_41 AC 24 ms
24,048 KB
testcase_42 AC 24 ms
24,384 KB
testcase_43 AC 25 ms
24,048 KB
testcase_44 AC 24 ms
23,652 KB
testcase_45 AC 25 ms
24,360 KB
testcase_46 AC 25 ms
24,384 KB
testcase_47 AC 26 ms
23,700 KB
testcase_48 AC 25 ms
24,288 KB
testcase_49 AC 25 ms
23,652 KB
testcase_50 AC 25 ms
23,580 KB
testcase_51 AC 25 ms
23,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define int long long
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--)
#define REP(i, n) for(int i=0; i<(n); i++)
#define RREP(i, n) for(int i=(n-1); i>=0; i--)
#define ALL(a) (a).begin(),(a).end()
#define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end());
#define CONTAIN(a, b) find(ALL(a), (b)) != (a).end()
#define array2(type, x, y) array<array<type, y>, x>
#define vector2(type) vector<vector<type> >
#define out(...) printf(__VA_ARGS__);fflush(stdout);

int dxy[] = {0, 1, 0, -1, 0};

void solve();
signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

/*================================*/

int N,M,Q;

void solve() {
    int A[4];
    REP(i,4)A[i]=i;
    int S0,S1,T;
    int F[4];
    REP(i,4)F[i]=-1;
    while(true) {
        out("%lld %lld %lld %lld\n", A[0],A[1],A[2],A[3]);
        cin>>S0>>T;
        if (S0 == 4) return;
        if (S0) {
            REP(i,4) {
                if (F[i]>-1) continue;
                A[i] = (A[i]+4)%10;
                out("%lld %lld %lld %lld\n", A[0],A[1],A[2],A[3]);
                cin>>S1>>T;
                if (S1 == 4) return;
                A[i]=(A[i]+6)%10;
                if (S1<S0) {
                    F[i]=A[i];
                }
            }
        }
        int ok = true;
        REP(i,4) ok = ok & (F[i]>-1);
        if (ok) break;
        REP(i,4) A[i]=(A[i]+1)%10;
    }
    
    out("%lld %lld %lld %lld\n", F[0],F[1],F[2],F[3]);
}
0