QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#496915#7179. Fischer's Chess Guessing Gameucup-team2307#AC ✓24ms3912kbC++2013.8kb2024-07-28 16:56:462024-07-28 16:56:46

Judging History

你现在查看的是最新测评结果

  • [2024-07-28 16:56:46]
  • 评测
  • 测评结果:AC
  • 用时:24ms
  • 内存:3912kb
  • [2024-07-28 16:56:46]
  • 提交

answer

#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back

typedef long long ll;
//#define int ll

using namespace std;

vector<string> pos =
{
"RNBKRQNB",
"QNRKNRBB",
"QNRKRNBB",
"NRNKBBQR",
"QBNRBNKR",
"RNKBRQBN",
"BBRQNNKR",
"QRBKNRNB",
"BNRKNRQB",
"BRQNKNRB",
"RNKBBNQR",
"RQKRBNNB",
"RBBKNNRQ",
"QRBBKNRN",
"QRBNKBRN",
"QBRKBNRN",
"RKBNQRNB",
"BRKRNNQB",
"RNBBKNQR",
"RQNBBNKR",
"BBNRKNRQ",
"RKBQNRNB",
"BQNRKBNR",
"RBQKNRBN",
"NRBKRBNQ",
"QRNBBKNR",
"NRKBRNBQ",
"RQKNRNBB",
"RNKBNQBR",
"RKBBNRQN",
"BRKRQNNB",
"BNRKRBQN",
"RKRNBNQB",
"RBBNNKRQ",
"RNQBBKNR",
"QRBKNBRN",
"RKRBNQBN",
"RQKBBRNN",
"BBRKNNRQ",
"BRNNKBRQ",
"RBQKBRNN",
"NRKBQNBR",
"RNKRNQBB",
"RKNQRBBN",
"NNRKBRQB",
"RKBBNNQR",
"RNKQBNRB",
"NQRKBNRB",
"BBQRNKRN",
"NNQBRKBR",
"RBQNNKBR",
"RKQNNRBB",
"RNQBNKBR",
"NQRKRNBB",
"BNQRKBRN",
"BRKNQBRN",
"BNRKQBNR",
"NRBKNBRQ",
"RBQKRNBN",
"BRKQRNNB",
"NBBNRQKR",
"NNBRKBRQ",
"RKNQBBNR",
"RBBQKRNN",
"QNRKBNRB",
"BQNRKNR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"RNBBNKQR",
"QNBNRKRB",
"RKRNNQBB",
"BQNRNKRB",
"BBNRKRQN",
"QNRBBKRN",
"BBRQNKRN",
"BQRBNKNR",
"NBNQRKBR",
"BRKBRNNQ",
"RKNRBQNB",
"BRQBKRNN",
"RNNQKRBB",
"NRKBBRQN",
"NNBRKBQR",
"BQRBKRNN",
"BNNRQKRB",
"NNRBBQKR",
"NBRKRQBN",
"QBBRNKRN",
"RKQRBNNB",
"RNNKRBBQ",
"RNBKRNQB",
"NNBRQKRB",
"RNKBQNBR",
"NBRQBNKR",
"RKBNRQNB",
"RKQBNNBR",
"BNQNRKRB",
"NNRKRBBQ",
"RQBKRNNB",
"NRBKNQRB",
"QNBBRNKR",
"BQRKNBRN",
"NBRQBKRN",
"NBNRBKQR",
"BRKNQNRB",
"BRQBNKNR",
"BRKNRBQN",
"BRNBNKRQ",
"RKNNBBRQ",
"QRNKNBBR",
"NQRNBBKR",
"BBRKNRQN",
"NNRKRQBB",
"BBNRKNQR",
"BRKQNRNB",
"RQBKNBRN",
"BRKNQBNR",
"RKNRQBBN",
"BNRKRQNB",
"RKRQBNNB",
"QNRBNKBR",
"RBKQNRBN",
"NNBBRQKR",
"QRNNKRBB",
"NRKRNQBB",
"RKNQBBRN",
"RKBNNRQB",
"RNBQNKRB",
"BBRKQNRN",
"NRNQKBBR",
"RKNQBRNB",
"NBBNQRKR",
"BRNBKRNQ",
"NRQKNRBB",
}
;
int ask(int j1, int j2)
{
    int ans = 0;
    for (int i=0; i<8; i++)
        if (pos[j1][i] == pos[j2][i])
            ans++;
    return ans;
}

int id = 0;
int ask(int id1)
{
    cout<<pos[id1]<<endl;
    int ans;
    cin>>ans;
    return ans;
//    return ask(id, id1);
}

void solve()
{
    vector<int> lt;
    for (int i=0; i<960; i++) lt.pb(i);
    int cnt = 0;
    while (true)
    {
        pair<int, int> mn = {1e9, -1};
        for (int ci=0; ci<min<int>(50, lt.size()); ci++)
        {
            int i = lt[ci];
            vector<int> ans(9);
            for (int j : lt)
                ans[ask(i, j)]++;
            int mx = 0;
            for (int j : ans)
                mx = max(mx, j);
            mn = min(mn, {mx, i});
        }

        cnt++;
        int i = mn.se;
        int a = ask(i);
        if (a == 8)
            break;

        vector<int> nw;
        for (int j : lt)
            if (ask(j, i) == a)
                nw.pb(j);
        lt = nw;
    }

//    if (cnt > 6)
//        cout<<lt[0]<<" "<<cnt<<"\n";
}

main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
//    cout<<pos.size()<<"\n";

//    for (id=0; id<960; id++)
//        solve();
//    return 0;

    while (true)
    {
        string s;
        cin>>s;
        if (s == "GAME")
        {
            int n;
            cin>>n;
            solve();
        }
        else
            return 0;
    }
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3704kb

input:

GAME 1
3
1
2
8
END

output:

RQNBBNKR
BNQBNRKR
RBBKQNNR
RKRBBQNN

result:

ok (c) correct after 1 tests, max moves 4 (1 test case)

Test #2:

score: 0
Accepted
time: 22ms
memory: 3672kb

input:

GAME 1
3
1
2
8
GAME 2
4
2
1
4
4
8
GAME 3
4
2
1
5
8
GAME 4
3
1
3
8
GAME 5
2
5
8
GAME 6
3
2
2
1
8
GAME 7
2
3
5
3
3
8
GAME 8
2
4
3
1
8
GAME 9
2
2
1
1
8
GAME 10
3
0
4
3
8
GAME 11
2
2
2
8
GAME 12
3
0
3
4
8
GAME 13
1
2
0
3
8
GAME 14
1
2
1
1
5
8
GAME 15
1
4
1
3
2
8
GAME 16
2
3
4
1
8
GAME 17
2
2
0
4
3
8
GAM...

output:

RQNBBNKR
BNQBNRKR
RBBKQNNR
RKRBBQNN
RQNBBNKR
BRQBNNKR
NBNQBRKR
RKNBRNBQ
RNKBBNRQ
RKRBBNQN
RQNBBNKR
BRQBNNKR
NBNQBRKR
RKNBRNBQ
RKRBBNNQ
RQNBBNKR
BNQBNRKR
RBBKQNNR
RKRBQNBN
RQNBBNKR
RKBBNRQN
RKRBNQBN
RQNBBNKR
BNQBNRKR
RQBKNBNR
NBBQRNKR
RKRBNNBQ
RQNBBNKR
RKBBNRQN
RKNQRBBN
RBNQKRBN
RKNRNBBQ
RKRQBBNN
RQN...

result:

ok (c) correct after 96 tests, max moves 6 (96 test cases)

Test #3:

score: 0
Accepted
time: 19ms
memory: 3708kb

input:

GAME 1
5
3
3
5
8
GAME 2
5
2
5
8
GAME 3
6
5
5
8
GAME 4
4
5
3
8
GAME 5
5
3
3
4
8
GAME 6
4
3
4
3
8
GAME 7
3
2
4
4
5
8
GAME 8
4
1
8
GAME 9
4
1
6
8
GAME 10
2
3
4
2
8
GAME 11
3
2
4
8
GAME 12
3
1
3
4
8
GAME 13
2
2
3
2
8
GAME 14
3
0
3
8
GAME 15
3
0
2
2
4
8
GAME 16
2
2
1
8
GAME 17
1
3
1
1
8
GAME 18
2
2
2
1
3...

output:

RQNBBNKR
BQRBNNKR
QBNRBNKR
RNKBBNQR
RKQBBNNR
RQNBBNKR
BQRBNNKR
RBNNBQKR
RKNBBQNR
RQNBBNKR
RNNBBQKR
RBNQBNKR
RKNBBNQR
RQNBBNKR
BRQBNNKR
BNRBQNKR
RKQBNNBR
RQNBBNKR
BQRBNNKR
QBNRBNKR
RNKBBNQR
RKNBQNBR
RQNBBNKR
BRQBNNKR
RKBBQNNR
RNQBBKNR
RKNBNQBR
RQNBBNKR
BNQBNRKR
RQBKNBNR
RKNQNBBR
RNKQBBNR
RKQNBBNR
RQN...

result:

ok (c) correct after 96 tests, max moves 6 (96 test cases)

Test #4:

score: 0
Accepted
time: 23ms
memory: 3816kb

input:

GAME 1
1
0
2
1
3
8
GAME 2
1
0
1
3
8
GAME 3
1
1
4
4
5
8
GAME 4
2
0
4
2
3
8
GAME 5
1
0
3
1
8
GAME 6
2
1
2
1
4
8
GAME 7
0
1
3
5
8
GAME 8
0
3
2
0
8
GAME 9
0
2
1
0
8
GAME 10
1
1
3
0
8
GAME 11
1
0
3
1
5
8
GAME 12
0
3
5
4
3
8
GAME 13
1
0
4
1
8
GAME 14
2
3
2
1
1
8
GAME 15
2
1
1
6
8
GAME 16
0
0
6
8
GAME 17
0...

output:

RQNBBNKR
RBBNNKRQ
BRQKRNNB
NNRKBRQB
NRKBRQBN
QRKRBBNN
RQNBBNKR
RBBNNKRQ
BRQKRNNB
NNQRKBBR
NRKRBBQN
RQNBBNKR
RBBNNKRQ
NRKNQBBR
NRBQKBNR
NRKQBBRN
NRKRBBNQ
RQNBBNKR
RKBBNRQN
NRQKBNRB
NQRKRNBB
BRNQKNRB
QRKRBNNB
RQNBBNKR
RBBNNKRQ
BRQKRNNB
BNRKQBNR
NRKRBQNB
RQNBBNKR
RKBBNRQN
NQBRKBNR
NNQBRKBR
RNKRBQNB
NRK...

result:

ok (c) correct after 96 tests, max moves 6 (96 test cases)

Test #5:

score: 0
Accepted
time: 24ms
memory: 3676kb

input:

GAME 1
3
0
4
4
8
GAME 2
1
1
2
0
2
8
GAME 3
2
1
1
3
3
8
GAME 4
4
1
2
4
8
GAME 5
2
1
0
6
8
GAME 6
2
1
0
5
8
GAME 7
1
3
3
8
GAME 8
1
4
3
2
2
8
GAME 9
1
5
5
8
GAME 10
2
3
2
1
8
GAME 11
3
1
3
2
8
GAME 12
3
1
4
2
3
8
GAME 13
1
3
2
8
GAME 14
2
3
4
3
3
8
GAME 15
2
3
3
1
3
8
GAME 16
2
4
4
8
GAME 17
1
2
1
6
8...

output:

RQNBBNKR
BNQBNRKR
RKNQBBRN
RQKRBBNN
RQNKRBBN
RQNBBNKR
RBBNNKRQ
NRKNQBBR
BRKRNNQB
NNRBKRBQ
RNQKRBBN
RQNBBNKR
RKBBNRQN
NQBRKBNR
NRKBRNBQ
RNKRQNBB
RNNKRBBQ
RQNBBNKR
BRQBNNKR
RKNQBBNR
RQNBKRBN
RQNKRNBB
RQNBBNKR
RKBBNRQN
NQBRKBNR
RNKQRNBB
RNQKRNBB
RQNBBNKR
RKBBNRQN
NQBRKBNR
RNKQRNBB
RNNKRQBB
RQNBBNKR
RBB...

result:

ok (c) correct after 96 tests, max moves 6 (96 test cases)

Test #6:

score: 0
Accepted
time: 22ms
memory: 3868kb

input:

GAME 1
0
1
3
8
GAME 2
0
3
5
3
8
GAME 3
0
2
1
2
8
GAME 4
1
3
2
2
8
GAME 5
1
2
4
2
8
GAME 6
0
3
8
GAME 7
2
1
1
1
5
8
GAME 8
1
1
3
1
8
GAME 9
2
0
5
3
8
GAME 10
3
0
3
2
8
GAME 11
2
0
8
GAME 12
2
0
6
5
8
GAME 13
1
1
3
3
8
GAME 14
2
0
2
4
8
GAME 15
2
2
4
8
GAME 16
1
2
1
3
3
8
GAME 17
1
1
5
8
GAME 18
1
2
1...

output:

RQNBBNKR
NNRKQRBB
BRKNNQRB
QRBKNBRN
RQNBBNKR
NNRKQRBB
NRBKNQRB
NNBRKQRB
NRBKQBRN
RQNBBNKR
NNRKQRBB
BBRNKRNQ
QNBNRKRB
NRBKNBRQ
RQNBBNKR
RBBNNKRQ
RNBNKRQB
RBQKNRBN
QRBKNNRB
RQNBBNKR
RBBNNKRQ
BRQNKNRB
BBRQKNRN
NRBKQNRB
RQNBBNKR
NNRKQRBB
NRBKNQRB
RQNBBNKR
RKBBNRQN
NQBRKBNR
NRKBRNBQ
QRNKBRNB
QRNKBBRN
RQN...

result:

ok (c) correct after 96 tests, max moves 6 (96 test cases)

Test #7:

score: 0
Accepted
time: 17ms
memory: 3640kb

input:

GAME 1
1
3
4
2
8
GAME 2
1
4
4
2
8
GAME 3
1
5
3
5
8
GAME 4
1
3
4
5
2
8
GAME 5
2
3
5
8
GAME 6
2
2
0
1
5
8
GAME 7
3
2
4
1
8
GAME 8
2
6
4
8
GAME 9
2
4
3
5
8
GAME 10
2
3
1
2
1
8
GAME 11
1
2
2
4
8
GAME 12
1
3
8
GAME 13
4
1
2
8
GAME 14
2
4
1
3
8
GAME 15
3
3
5
3
8
GAME 16
3
1
1
8
GAME 17
1
2
4
1
2
8
GAME 18...

output:

RQNBBNKR
RBBNNKRQ
RNBNKRQB
RKQNNRBB
RBBQKRNN
RQNBBNKR
RBBNNKRQ
NBBNRKQR
QBRNNKBR
RBBNKRQN
RQNBBNKR
RBBNNKRQ
RNBKNBRQ
RBBNKQRN
RBBNKRNQ
RQNBBNKR
RBBNNKRQ
RNBNKRQB
RKQNNRBB
RKBQNRNB
RBQNKRBN
RQNBBNKR
RKBBNRQN
RKNQRBBN
RBNQKRBN
RQNBBNKR
RKBBNRQN
BRKBNQNR
RNBKQNRB
RKNNRBBQ
RBNNKRBQ
RQNBBNKR
BNQBNRKR
RQB...

result:

ok (c) correct after 96 tests, max moves 6 (96 test cases)

Test #8:

score: 0
Accepted
time: 21ms
memory: 3912kb

input:

GAME 1
4
4
2
3
8
GAME 2
3
3
1
4
8
GAME 3
3
2
1
5
8
GAME 4
2
0
1
2
3
8
GAME 5
1
1
6
5
8
GAME 6
2
0
2
3
3
8
GAME 7
0
2
6
8
GAME 8
0
2
6
6
8
GAME 9
0
2
8
GAME 10
2
3
1
0
4
8
GAME 11
1
0
1
2
8
GAME 12
1
1
0
3
8
GAME 13
1
1
1
2
8
GAME 14
0
4
4
3
8
GAME 15
0
4
3
2
8
GAME 16
0
3
0
8
GAME 17
0
4
8
GAME 18
0...

output:

RQNBBNKR
BRQBNNKR
BQNRNBKR
RKBBNNQR
QRNBKNBR
RQNBBNKR
BNQBNRKR
RNKBBRNQ
QRNBNKBR
NRQBKNBR
RQNBBNKR
BNQBNRKR
RQBKNBNR
NRKBQNBR
NRNBKQBR
RQNBBNKR
RKBBNRQN
NRQKBNRB
BBRQKNNR
BNQNRBKR
QRNNKBBR
RQNBBNKR
RBBNNKRQ
NRKNQBBR
NRKQNBBR
NRQNKBBR
RQNBBNKR
RKBBNRQN
NRQKBNRB
QRKNBBNR
NBRQBKNR
NRNQKBBR
RQNBBNKR
NNR...

result:

ok (c) correct after 96 tests, max moves 6 (96 test cases)

Test #9:

score: 0
Accepted
time: 21ms
memory: 3628kb

input:

GAME 1
2
1
5
4
8
GAME 2
1
2
1
3
8
GAME 3
2
2
1
3
3
8
GAME 4
3
1
3
2
2
8
GAME 5
2
0
3
3
3
8
GAME 6
2
0
1
3
4
8
GAME 7
1
1
2
1
8
GAME 8
2
1
8
GAME 9
1
1
3
5
8
GAME 10
2
0
0
2
8
GAME 11
3
1
1
4
4
8
GAME 12
1
0
1
8
GAME 13
1
6
6
8
GAME 14
1
6
8
GAME 15
1
8
GAME 16
2
2
0
2
8
GAME 17
3
0
6
4
8
GAME 18
3
0...

output:

RQNBBNKR
RKBBNRQN
NQBRKBNR
NQBRKNRB
QBBRKNNR
RQNBBNKR
RBBNNKRQ
BRQNKNRB
RNBKRQNB
NBBRKQNR
RQNBBNKR
RKBBNRQN
BRKBNQNR
RBKRQNBN
RBBKRNNQ
NBBRKNQR
RQNBBNKR
BNQBNRKR
RBBKQNNR
RKRBQNBN
RBNKBRQN
QBNRKNBR
RQNBBNKR
RKBBNRQN
NRQKBNRB
NRNKQBBR
NBRKBQNR
NBQRKNBR
RQNBBNKR
RKBBNRQN
NRQKBNRB
BBRQKNNR
NQRNKBBR
NBN...

result:

ok (c) correct after 96 tests, max moves 6 (96 test cases)

Test #10:

score: 0
Accepted
time: 21ms
memory: 3700kb

input:

GAME 1
1
3
0
6
8
GAME 2
1
3
1
4
8
GAME 3
1
4
5
2
8
GAME 4
3
4
4
2
4
8
GAME 5
2
1
2
4
8
GAME 6
2
3
0
2
8
GAME 7
2
0
1
4
8
GAME 8
2
0
2
3
8
GAME 9
2
1
2
3
8
GAME 10
1
4
4
8
GAME 11
1
3
0
8
GAME 12
1
3
1
4
6
8
GAME 13
3
3
4
5
8
GAME 14
4
2
3
8
GAME 15
3
3
3
2
8
GAME 16
2
2
3
3
5
8
GAME 17
3
3
1
5
8
GAM...

output:

RQNBBNKR
RBBNNKRQ
RNBNKRQB
NBRQNKBR
BBRQNKNR
RQNBBNKR
RBBNNKRQ
RNBNKRQB
NBBQRKNR
BBRNQKNR
RQNBBNKR
RBBNNKRQ
NBBNRKQR
NQBNRKRB
BBRNNKQR
RQNBBNKR
BNQBNRKR
BBRQNNKR
BNNQRBKR
BRKBNNQR
BQRBNKNR
RQNBBNKR
RKBBNRQN
NQBRKBNR
NNQBRKBR
BNRBQKNR
RQNBBNKR
RKBBNRQN
RKNQRBBN
QBBNNRKR
BNRBNKQR
RQNBBNKR
RKBBNRQN
NRQ...

result:

ok (c) correct after 96 tests, max moves 6 (96 test cases)

Test #11:

score: 0
Accepted
time: 17ms
memory: 3644kb

input:

GAME 1
8
GAME 2
6
6
8
GAME 3
6
8
GAME 4
6
5
5
4
8
GAME 5
4
3
2
4
8
GAME 6
5
2
5
4
4
8
GAME 7
4
8
GAME 8
5
5
4
8
GAME 9
4
6
5
8
GAME 10
2
1
2
2
8
GAME 11
3
4
5
5
8
GAME 12
3
3
0
2
8
GAME 13
4
6
8
GAME 14
4
5
5
8
GAME 15
3
4
3
3
8
GAME 16
2
2
3
2
0
8
GAME 17
2
2
3
1
8
GAME 18
2
1
4
5
8
GAME 19
6
5
5
5...

output:

RQNBBNKR
RQNBBNKR
RNNBBQKR
RNQBBNKR
RQNBBNKR
RNNBBQKR
RQNBBNKR
RNNBBQKR
RBNQBNKR
RKNBBNQR
RQNNBBKR
RQNBBNKR
BRQBNNKR
RKBBQNNR
QBRNBNKR
RNQNBBKR
RQNBBNKR
BQRBNNKR
RBNNBQKR
RKNBBQNR
RBNKBNQR
RNNQBBKR
RQNBBNKR
BRQBNNKR
RQNBBNKR
BQRBNNKR
QNRBBNKR
BRNBQNKR
RQNBBNKR
BRQBNNKR
QRBBNNKR
BRNBNQKR
RQNBBNKR
RKB...

result:

ok (c) correct after 96 tests, max moves 6 (96 test cases)

Extra Test:

score: 0
Extra Test Passed