QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#210906#7179. Fischer's Chess Guessing Gameucup-team191#AC ✓89ms4544kbC++1412.5kb2023-10-11 21:20:582023-10-11 21:20:58

Judging History

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

  • [2023-10-11 21:20:58]
  • 评测
  • 测评结果:AC
  • 用时:89ms
  • 内存:4544kb
  • [2023-10-11 21:20:58]
  • 提交

answer

#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
using ll=long long;
using ld=long double;
using pii=pair<int,int>;
using vi=vector<int>;
using vl=vector<ll>;
#define pb push_back
#define all(a) begin(a),end(a)

const int N=300010,MOD=1e9+7;
const char en='\n';
const ll LLINF=1ll<<60;

int n,mad;

int ko(string a,string b)
{
	int cn=0;
	for (int i=0;i<8;++i) if (a[i]==b[i]) ++cn;
	return cn;
}

map<vector<string>,string> koj;
vector<string> sve={"NNBBRKRQ","BNNBRKRQ","NBBNRKRQ","BBNNRKRQ","NBNRBKRQ","NNRBBKRQ","NRNBBKRQ","RNNBBKRQ","NBRNBKRQ","RBNNBKRQ","NBBRNKRQ","BBNRNKRQ","BNRBNKRQ","NRBBNKRQ","RNBBNKRQ","BRNBNKRQ","BBRNNKRQ","RBBNNKRQ","NNBRKBRQ","BNNRKBRQ","BNRNKBRQ","NRBNKBRQ","RNBNKBRQ","BRNNKBRQ","NNRKBBRQ","NRNKBBRQ","RNNKBBRQ","NRKNBBRQ","RNKNBBRQ","RKNNBBRQ","BNRKNBRQ","NRBKNBRQ","RNBKNBRQ","BRNKNBRQ","BRKNNBRQ","RKBNNBRQ","NBBRKNRQ","BBNRKNRQ","BNRBKNRQ","NRBBKNRQ","RNBBKNRQ","BRNBKNRQ","BBRNKNRQ","RBBNKNRQ","NBRKBNRQ","RBNKBNRQ","NRKBBNRQ","RNKBBNRQ","RKNBBNRQ","RBKNBNRQ","BBRKNNRQ","RBBKNNRQ","BRKBNNRQ","RKBBNNRQ","NBNRKRBQ","NNRBKRBQ","NRNBKRBQ","RNNBKRBQ","NBRNKRBQ","RBNNKRBQ","NBRKNRBQ","RBNKNRBQ","NRKBNRBQ","RNKBNRBQ","RKNBNRBQ","RBKNNRBQ","NNRKRBBQ","NRNKRBBQ","RNNKRBBQ","NRKNRBBQ","RNKNRBBQ","RKNNRBBQ","NRKRNBBQ","RNKRNBBQ","RKNRNBBQ","RKRNNBBQ","NBRKRNBQ","RBNKRNBQ","NRKBRNBQ","RNKBRNBQ","RKNBRNBQ","RBKNRNBQ","RBKRNNBQ","RKRBNNBQ","NBBRKRNQ","BBNRKRNQ","BNRBKRNQ","NRBBKRNQ","RNBBKRNQ","BRNBKRNQ","BBRNKRNQ","RBBNKRNQ","NBRKBRNQ","RBNKBRNQ","NRKBBRNQ","RNKBBRNQ","RKNBBRNQ","RBKNBRNQ","BBRKNRNQ","RBBKNRNQ","BRKBNRNQ","RKBBNRNQ","BNRKRBNQ","NRBKRBNQ","RNBKRBNQ","BRNKRBNQ","BRKNRBNQ","RKBNRBNQ","NRKRBBNQ","RNKRBBNQ","RKNRBBNQ","RKRNBBNQ","BRKRNBNQ","RKBRNBNQ","BBRKRNNQ","RBBKRNNQ","BRKBRNNQ","RKBBRNNQ","RBKRBNNQ","RKRBBNNQ","NNBBRKQR","BNNBRKQR","NBBNRKQR","BBNNRKQR","NBNRBKQR","NNRBBKQR","NRNBBKQR","RNNBBKQR","NBRNBKQR","RBNNBKQR","NBBRNKQR","BBNRNKQR","BNRBNKQR","NRBBNKQR","RNBBNKQR","BRNBNKQR","BBRNNKQR","RBBNNKQR","NNBRKBQR","BNNRKBQR","BNRNKBQR","NRBNKBQR","RNBNKBQR","BRNNKBQR","NNRKBBQR","NRNKBBQR","RNNKBBQR","NRKNBBQR","RNKNBBQR","RKNNBBQR","BNRKNBQR","NRBKNBQR","RNBKNBQR","BRNKNBQR","BRKNNBQR","RKBNNBQR","NBBRKNQR","BBNRKNQR","BNRBKNQR","NRBBKNQR","RNBBKNQR","BRNBKNQR","BBRNKNQR","RBBNKNQR","NBRKBNQR","RBNKBNQR","NRKBBNQR","RNKBBNQR","RKNBBNQR","RBKNBNQR","BBRKNNQR","RBBKNNQR","BRKBNNQR","RKBBNNQR","NNBBRQKR","BNNBRQKR","NBBNRQKR","BBNNRQKR","NBNRBQKR","NNRBBQKR","NRNBBQKR","RNNBBQKR","NBRNBQKR","RBNNBQKR","NBBRNQKR","BBNRNQKR","BNRBNQKR","NRBBNQKR","RNBBNQKR","BRNBNQKR","BBRNNQKR","RBBNNQKR","NNBBQRKR","BNNBQRKR","NBBNQRKR","BBNNQRKR","NBNQBRKR","NNQBBRKR","NQNBBRKR","QNNBBRKR","NBQNBRKR","QBNNBRKR","NBBQNRKR","BBNQNRKR","BNQBNRKR","NQBBNRKR","QNBBNRKR","BQNBNRKR","BBQNNRKR","QBBNNRKR","NNBRQBKR","BNNRQBKR","BNRNQBKR","NRBNQBKR","RNBNQBKR","BRNNQBKR","NNBQRBKR","BNNQRBKR","BNQNRBKR","NQBNRBKR","QNBNRBKR","BQNNRBKR","NNRQBBKR","NRNQBBKR","RNNQBBKR","NNQRBBKR","NQNRBBKR","QNNRBBKR","NRQNBBKR","RNQNBBKR","NQRNBBKR","QNRNBBKR","RQNNBBKR","QRNNBBKR","BNRQNBKR","NRBQNBKR","RNBQNBKR","BRNQNBKR","BNQRNBKR","NQBRNBKR","QNBRNBKR","BQNRNBKR","BRQNNBKR","BQRNNBKR","RQBNNBKR","QRBNNBKR","NBBRQNKR","BBNRQNKR","BNRBQNKR","NRBBQNKR","RNBBQNKR","BRNBQNKR","BBRNQNKR","RBBNQNKR","NBBQRNKR","BBNQRNKR","BNQBRNKR","NQBBRNKR","QNBBRNKR","BQNBRNKR","BBQNRNKR","QBBNRNKR","NBRQBNKR","RBNQBNKR","NBQRBNKR","QBNRBNKR","NRQBBNKR","RNQBBNKR","NQRBBNKR","QNRBBNKR","RQNBBNKR","QRNBBNKR","RBQNBNKR","QBRNBNKR","BBRQNNKR","RBBQNNKR","BBQRNNKR","QBBRNNKR","BRQBNNKR","BQRBNNKR","RQBBNNKR","QRBBNNKR","NBNRKQBR","NNRBKQBR","NRNBKQBR","RNNBKQBR","NBRNKQBR","RBNNKQBR","NBRKNQBR","RBNKNQBR","NRKBNQBR","RNKBNQBR","RKNBNQBR","RBKNNQBR","NBNRQKBR","NNRBQKBR","NRNBQKBR","RNNBQKBR","NBRNQKBR","RBNNQKBR","NBNQRKBR","NNQBRKBR","NQNBRKBR","QNNBRKBR","NBQNRKBR","QBNNRKBR","NBRQNKBR","RBNQNKBR","NBQRNKBR","QBNRNKBR","NRQBNKBR","RNQBNKBR","NQRBNKBR","QNRBNKBR","RQNBNKBR","QRNBNKBR","RBQNNKBR","QBRNNKBR","NNRKQBBR","NRNKQBBR","RNNKQBBR","NRKNQBBR","RNKNQBBR","RKNNQBBR","NNRQKBBR","NRNQKBBR","RNNQKBBR","NNQRKBBR","NQNRKBBR","QNNRKBBR","NRQNKBBR","RNQNKBBR","NQRNKBBR","QNRNKBBR","RQNNKBBR","QRNNKBBR","NRKQNBBR","RNKQNBBR","RKNQNBBR","NRQKNBBR","RNQKNBBR","NQRKNBBR","QNRKNBBR","RQNKNBBR","QRNKNBBR","RKQNNBBR","RQKNNBBR","QRKNNBBR","NBRKQNBR","RBNKQNBR","NRKBQNBR","RNKBQNBR","RKNBQNBR","RBKNQNBR","NBRQKNBR","RBNQKNBR","NBQRKNBR","QBNRKNBR","NRQBKNBR","RNQBKNBR","NQRBKNBR","QNRBKNBR","RQNBKNBR","QRNBKNBR","RBQNKNBR","QBRNKNBR","RBKQNNBR","RBQKNNBR","QBRKNNBR","RKQBNNBR","RQKBNNBR","QRKBNNBR","NBBRKQNR","BBNRKQNR","BNRBKQNR","NRBBKQNR","RNBBKQNR","BRNBKQNR","BBRNKQNR","RBBNKQNR","NBRKBQNR","RBNKBQNR","NRKBBQNR","RNKBBQNR","RKNBBQNR","RBKNBQNR","BBRKNQNR","RBBKNQNR","BRKBNQNR","RKBBNQNR","NBBRQKNR","BBNRQKNR","BNRBQKNR","NRBBQKNR","RNBBQKNR","BRNBQKNR","BBRNQKNR","RBBNQKNR","NBBQRKNR","BBNQRKNR","BNQBRKNR","NQBBRKNR","QNBBRKNR","BQNBRKNR","BBQNRKNR","QBBNRKNR","NBRQBKNR","RBNQBKNR","NBQRBKNR","QBNRBKNR","NRQBBKNR","RNQBBKNR","NQRBBKNR","QNRBBKNR","RQNBBKNR","QRNBBKNR","RBQNBKNR","QBRNBKNR","BBRQNKNR","RBBQNKNR","BBQRNKNR","QBBRNKNR","BRQBNKNR","BQRBNKNR","RQBBNKNR","QRBBNKNR","BNRKQBNR","NRBKQBNR","RNBKQBNR","BRNKQBNR","BRKNQBNR","RKBNQBNR","BNRQKBNR","NRBQKBNR","RNBQKBNR","BRNQKBNR","BNQRKBNR","NQBRKBNR","QNBRKBNR","BQNRKBNR","BRQNKBNR","BQRNKBNR","RQBNKBNR","QRBNKBNR","NRKQBBNR","RNKQBBNR","RKNQBBNR","NRQKBBNR","RNQKBBNR","NQRKBBNR","QNRKBBNR","RQNKBBNR","QRNKBBNR","RKQNBBNR","RQKNBBNR","QRKNBBNR","BRKQNBNR","RKBQNBNR","BRQKNBNR","BQRKNBNR","RQBKNBNR","QRBKNBNR","BBRKQNNR","RBBKQNNR","BRKBQNNR","RKBBQNNR","BBRQKNNR","RBBQKNNR","BBQRKNNR","QBBRKNNR","BRQBKNNR","BQRBKNNR","RQBBKNNR","QRBBKNNR","RBKQBNNR","RBQKBNNR","QBRKBNNR","RKQBBNNR","RQKBBNNR","QRKBBNNR","NNBRKRQB","BNNRKRQB","BNRNKRQB","NRBNKRQB","RNBNKRQB","BRNNKRQB","NNRKBRQB","NRNKBRQB","RNNKBRQB","NRKNBRQB","RNKNBRQB","RKNNBRQB","BNRKNRQB","NRBKNRQB","RNBKNRQB","BRNKNRQB","BRKNNRQB","RKBNNRQB","BNRKRNQB","NRBKRNQB","RNBKRNQB","BRNKRNQB","BRKNRNQB","RKBNRNQB","NRKRBNQB","RNKRBNQB","RKNRBNQB","RKRNBNQB","BRKRNNQB","RKBRNNQB","NNBRKQRB","BNNRKQRB","BNRNKQRB","NRBNKQRB","RNBNKQRB","BRNNKQRB","NNRKBQRB","NRNKBQRB","RNNKBQRB","NRKNBQRB","RNKNBQRB","RKNNBQRB","BNRKNQRB","NRBKNQRB","RNBKNQRB","BRNKNQRB","BRKNNQRB","RKBNNQRB","NNBRQKRB","BNNRQKRB","BNRNQKRB","NRBNQKRB","RNBNQKRB","BRNNQKRB","NNBQRKRB","BNNQRKRB","BNQNRKRB","NQBNRKRB","QNBNRKRB","BQNNRKRB","NNRQBKRB","NRNQBKRB","RNNQBKRB","NNQRBKRB","NQNRBKRB","QNNRBKRB","NRQNBKRB","RNQNBKRB","NQRNBKRB","QNRNBKRB","RQNNBKRB","QRNNBKRB","BNRQNKRB","NRBQNKRB","RNBQNKRB","BRNQNKRB","BNQRNKRB","NQBRNKRB","QNBRNKRB","BQNRNKRB","BRQNNKRB","BQRNNKRB","RQBNNKRB","QRBNNKRB","BNRKQNRB","NRBKQNRB","RNBKQNRB","BRNKQNRB","BRKNQNRB","RKBNQNRB","BNRQKNRB","NRBQKNRB","RNBQKNRB","BRNQKNRB","BNQRKNRB","NQBRKNRB","QNBRKNRB","BQNRKNRB","BRQNKNRB","BQRNKNRB","RQBNKNRB","QRBNKNRB","NRKQBNRB","RNKQBNRB","RKNQBNRB","NRQKBNRB","RNQKBNRB","NQRKBNRB","QNRKBNRB","RQNKBNRB","QRNKBNRB","RKQNBNRB","RQKNBNRB","QRKNBNRB","BRKQNNRB","RKBQNNRB","BRQKNNRB","BQRKNNRB","RQBKNNRB","QRBKNNRB","NNRKRQBB","NRNKRQBB","RNNKRQBB","NRKNRQBB","RNKNRQBB","RKNNRQBB","NRKRNQBB","RNKRNQBB","RKNRNQBB","RKRNNQBB","NNRKQRBB","NRNKQRBB","RNNKQRBB","NRKNQRBB","RNKNQRBB","RKNNQRBB","NNRQKRBB","NRNQKRBB","RNNQKRBB","NNQRKRBB","NQNRKRBB","QNNRKRBB","NRQNKRBB","RNQNKRBB","NQRNKRBB","QNRNKRBB","RQNNKRBB","QRNNKRBB","NRKQNRBB","RNKQNRBB","RKNQNRBB","NRQKNRBB","RNQKNRBB","NQRKNRBB","QNRKNRBB","RQNKNRBB","QRNKNRBB","RKQNNRBB","RQKNNRBB","QRKNNRBB","NRKRQNBB","RNKRQNBB","RKNRQNBB","RKRNQNBB","NRKQRNBB","RNKQRNBB","RKNQRNBB","NRQKRNBB","RNQKRNBB","NQRKRNBB","QNRKRNBB","RQNKRNBB","QRNKRNBB","RKQNRNBB","RQKNRNBB","QRKNRNBB","RKRQNNBB","RKQRNNBB","RQKRNNBB","QRKRNNBB","BNRKRQNB","NRBKRQNB","RNBKRQNB","BRNKRQNB","BRKNRQNB","RKBNRQNB","NRKRBQNB","RNKRBQNB","RKNRBQNB","RKRNBQNB","BRKRNQNB","RKBRNQNB","BNRKQRNB","NRBKQRNB","RNBKQRNB","BRNKQRNB","BRKNQRNB","RKBNQRNB","BNRQKRNB","NRBQKRNB","RNBQKRNB","BRNQKRNB","BNQRKRNB","NQBRKRNB","QNBRKRNB","BQNRKRNB","BRQNKRNB","BQRNKRNB","RQBNKRNB","QRBNKRNB","NRKQBRNB","RNKQBRNB","RKNQBRNB","NRQKBRNB","RNQKBRNB","NQRKBRNB","QNRKBRNB","RQNKBRNB","QRNKBRNB","RKQNBRNB","RQKNBRNB","QRKNBRNB","BRKQNRNB","RKBQNRNB","BRQKNRNB","BQRKNRNB","RQBKNRNB","QRBKNRNB","BRKRQNNB","RKBRQNNB","BRKQRNNB","RKBQRNNB","BRQKRNNB","BQRKRNNB","RQBKRNNB","QRBKRNNB","RKRQBNNB","RKQRBNNB","RQKRBNNB","QRKRBNNB","NBBRKRQN","BBNRKRQN","BNRBKRQN","NRBBKRQN","RNBBKRQN","BRNBKRQN","BBRNKRQN","RBBNKRQN","NBRKBRQN","RBNKBRQN","NRKBBRQN","RNKBBRQN","RKNBBRQN","RBKNBRQN","BBRKNRQN","RBBKNRQN","BRKBNRQN","RKBBNRQN","BNRKRBQN","NRBKRBQN","RNBKRBQN","BRNKRBQN","BRKNRBQN","RKBNRBQN","NRKRBBQN","RNKRBBQN","RKNRBBQN","RKRNBBQN","BRKRNBQN","RKBRNBQN","BBRKRNQN","RBBKRNQN","BRKBRNQN","RKBBRNQN","RBKRBNQN","RKRBBNQN","NBBRKQRN","BBNRKQRN","BNRBKQRN","NRBBKQRN","RNBBKQRN","BRNBKQRN","BBRNKQRN","RBBNKQRN","NBRKBQRN","RBNKBQRN","NRKBBQRN","RNKBBQRN","RKNBBQRN","RBKNBQRN","BBRKNQRN","RBBKNQRN","BRKBNQRN","RKBBNQRN","NBBRQKRN","BBNRQKRN","BNRBQKRN","NRBBQKRN","RNBBQKRN","BRNBQKRN","BBRNQKRN","RBBNQKRN","NBBQRKRN","BBNQRKRN","BNQBRKRN","NQBBRKRN","QNBBRKRN","BQNBRKRN","BBQNRKRN","QBBNRKRN","NBRQBKRN","RBNQBKRN","NBQRBKRN","QBNRBKRN","NRQBBKRN","RNQBBKRN","NQRBBKRN","QNRBBKRN","RQNBBKRN","QRNBBKRN","RBQNBKRN","QBRNBKRN","BBRQNKRN","RBBQNKRN","BBQRNKRN","QBBRNKRN","BRQBNKRN","BQRBNKRN","RQBBNKRN","QRBBNKRN","BNRKQBRN","NRBKQBRN","RNBKQBRN","BRNKQBRN","BRKNQBRN","RKBNQBRN","BNRQKBRN","NRBQKBRN","RNBQKBRN","BRNQKBRN","BNQRKBRN","NQBRKBRN","QNBRKBRN","BQNRKBRN","BRQNKBRN","BQRNKBRN","RQBNKBRN","QRBNKBRN","NRKQBBRN","RNKQBBRN","RKNQBBRN","NRQKBBRN","RNQKBBRN","NQRKBBRN","QNRKBBRN","RQNKBBRN","QRNKBBRN","RKQNBBRN","RQKNBBRN","QRKNBBRN","BRKQNBRN","RKBQNBRN","BRQKNBRN","BQRKNBRN","RQBKNBRN","QRBKNBRN","BBRKQNRN","RBBKQNRN","BRKBQNRN","RKBBQNRN","BBRQKNRN","RBBQKNRN","BBQRKNRN","QBBRKNRN","BRQBKNRN","BQRBKNRN","RQBBKNRN","QRBBKNRN","RBKQBNRN","RBQKBNRN","QBRKBNRN","RKQBBNRN","RQKBBNRN","QRKBBNRN","NBRKRQBN","RBNKRQBN","NRKBRQBN","RNKBRQBN","RKNBRQBN","RBKNRQBN","RBKRNQBN","RKRBNQBN","NBRKQRBN","RBNKQRBN","NRKBQRBN","RNKBQRBN","RKNBQRBN","RBKNQRBN","NBRQKRBN","RBNQKRBN","NBQRKRBN","QBNRKRBN","NRQBKRBN","RNQBKRBN","NQRBKRBN","QNRBKRBN","RQNBKRBN","QRNBKRBN","RBQNKRBN","QBRNKRBN","RBKQNRBN","RBQKNRBN","QBRKNRBN","RKQBNRBN","RQKBNRBN","QRKBNRBN","NRKRQBBN","RNKRQBBN","RKNRQBBN","RKRNQBBN","NRKQRBBN","RNKQRBBN","RKNQRBBN","NRQKRBBN","RNQKRBBN","NQRKRBBN","QNRKRBBN","RQNKRBBN","QRNKRBBN","RKQNRBBN","RQKNRBBN","QRKNRBBN","RKRQNBBN","RKQRNBBN","RQKRNBBN","QRKRNBBN","RBKRQNBN","RKRBQNBN","RBKQRNBN","RBQKRNBN","QBRKRNBN","RKQBRNBN","RQKBRNBN","QRKBRNBN","BBRKRQNN","RBBKRQNN","BRKBRQNN","RKBBRQNN","RBKRBQNN","RKRBBQNN","BBRKQRNN","RBBKQRNN","BRKBQRNN","RKBBQRNN","BBRQKRNN","RBBQKRNN","BBQRKRNN","QBBRKRNN","BRQBKRNN","BQRBKRNN","RQBBKRNN","QRBBKRNN","RBKQBRNN","RBQKBRNN","QBRKBRNN","RKQBBRNN","RQKBBRNN","QRKBBRNN","BRKRQBNN","RKBRQBNN","BRKQRBNN","RKBQRBNN","BRQKRBNN","BQRKRBNN","RQBKRBNN","QRBKRBNN","RKRQBBNN","RKQRBBNN","RQKRBBNN","QRKRBBNN"};

void nap(vector<string> v,int d)
{
	if (v.size()<=1)
	{
		mad=max(mad,d+(int)v.size());
		if (v.size()==1) koj[v]=v[0];
		return;
	}
	ld maxsl=-1;
	string kak="??";
	for (auto x: sve)
	{
		vi u(9);
		for (auto y: v) ++u[ko(x,y)];
		ld s=0;
		for (auto y: u) s+=log(y+1);
		if (s>maxsl)
		{
			maxsl=s;
			kak=x;
		}
	}
	vector<vector<string>> u(9);
	for (auto y: v) u[ko(kak,y)].pb(y);
	for (int i=0;i<8;++i) nap(u[i],d+1);
	koj[v]=kak;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	vector<string> v;
	/*for (int b=0;b<(1<<24);++b) //QKRBN
	{
		vi cn(8);
		for (int i=0;i<8;++i) ++cn[(b>>(i*3))&7];
		if (cn[0]!=1 || cn[1]!=1 || cn[2]!=2 || cn[3]!=2 || cn[4]!=2) continue;
		int p1=-1,p2=-1;
		for (int i=0;i<8;++i) if (((b>>(i*3))&7)==3)
		{
			if (p1==-1) p1=i;
			else p2=i;
		}
		if ((p1+p2)%2==0) continue;
		p1=-1,p2=-1;
		for (int i=0;i<8;++i) if (((b>>(i*3))&7)==2)
		{
			if (p1==-1) p1=i;
			else p2=i;
		}
		bool ok=1;
		for (int i=0;i<8;++i) if (((b>>(i*3))&7)==1)
		{
			if (i<p1 || i>p2) ok=0;
		}
		string s,u="QKRBN";
		for (int i=0;i<8;++i) s.pb(u[(b>>(i*3))&7]);
		if (ok) v.pb(s);
	}
	freopen("re.txt","w",stdout);
	cout<<"{";
	for (int i=0;i<(int)v.size();++i)
    {
        if (i) cout<<",";
        cout<<"\""<<v[i]<<"\"";
    }
    cout<<"}";
    exit(0);*/
    nap(sve,0);
	while (1)
	{
		string w;
		cin>>w;
		if (w=="END") exit(0);
		int c;
		cin>>c;
		auto mog=sve;
		while (1)
		{
		    string qu=koj[mog];
		    cout<<qu<<endl;
		    int cn;
		    cin>>cn;
		    if (cn==8) break;
		    vector<string> nov;
		    for (auto x: mog) if (ko(x,qu)==cn) nov.pb(x);
		    mog=nov;
		}
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 80ms
memory: 4192kb

input:

GAME 1
1
1
3
1
0
8
END

output:

RNBNQBKR
BNRQKNRB
QRBBKRNN
QRNBNKBR
NBBNRKRQ
RKRBBQNN

result:

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

Test #2:

score: 0
Accepted
time: 85ms
memory: 4340kb

input:

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

output:

RNBNQBKR
BNRQKNRB
QRBBKRNN
QRNBNKBR
NBBNRKRQ
RKRBBQNN
RNBNQBKR
BNRQKNRB
RKNBBNRQ
NRBBNKRQ
RKRBBNQN
RNBNQBKR
BNRQKNRB
RKNBBNRQ
NBRNBKRQ
RKRBBNNQ
RNBNQBKR
RQKNBNRB
RQNBBNKR
RKBNRBNQ
BNNBRKRQ
RKRBQNBN
RNBNQBKR
BNRQKNRB
QRBBKRNN
NRNKBRQB
RKBNNBRQ
RKRBNQBN
RNBNQBKR
BNRQKNRB
RKNBBNRQ
NRBBNKRQ
RKRBNNBQ
RNB...

result:

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

Test #3:

score: 0
Accepted
time: 79ms
memory: 4400kb

input:

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

output:

RNBNQBKR
RQKNBNRB
RKNBBNQR
NNBBRKRQ
RKQBBNNR
RNBNQBKR
RQKNBNRB
RQNBBNKR
RKNRNBBQ
RKNBBQNR
RNBNQBKR
RQKNBNRB
RKNBBNQR
RNBNQBKR
RQKNBNRB
RQNBBNKR
NBRNBQKR
RKQBNNBR
RNBNQBKR
RKBNNQRB
QRBBNNKR
BBRNNKRQ
RKNBQNBR
RNBNQBKR
RQKNBNRB
BBRQNNKR
QNRBBNKR
NBNRBKRQ
RKNBNQBR
RNBNQBKR
NRQNBBKR
NRBKNBRQ
RKQNBBNR
RNB...

result:

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

Test #4:

score: 0
Accepted
time: 88ms
memory: 4324kb

input:

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

output:

RNBNQBKR
BNRQKNRB
RBQKNRBN
NNRBQKBR
QRKRBBNN
RNBNQBKR
BNRQKNRB
RBQKNRBN
NNRBQKBR
NRKRBBQN
RNBNQBKR
BNRQKNRB
RBQKNRBN
NRKNBBRQ
NRKRBBNQ
RNBNQBKR
NRKQBNRB
RBNKBNRQ
NNBBRKRQ
QRKRBNNB
RNBNQBKR
NRKQBNRB
RBNKBNRQ
BNNBRKRQ
NRKRBQNB
RNBNQBKR
NRKQBNRB
NBNRBKRQ
NNBBRKRQ
NRKRBNQB
RNBNQBKR
BNRQKNRB
RBQKNRBN
NRN...

result:

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

Test #5:

score: 0
Accepted
time: 89ms
memory: 4320kb

input:

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

output:

RNBNQBKR
RQKNBNRB
RQNBBNKR
RKBNRBNQ
NNBBRKRQ
RQNKRBBN
RNBNQBKR
RKBNNQRB
QBRNBNKR
NNRKBBRQ
RNQKRBBN
RNBNQBKR
RKBNNQRB
QBRNBNKR
NNRKBBRQ
RNNKRBBQ
RNBNQBKR
BNRQKNRB
RKNBBNRQ
BNNBRKRQ
NBBNRKRQ
RQNKRNBB
RNBNQBKR
RQKNBNRB
RKNBBNQR
NBBRNKRQ
NNBBRKRQ
RNQKRNBB
RNBNQBKR
RQKNBNRB
RQNBBNKR
RNBKRQNB
RNNKRQBB
RNB...

result:

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

Test #6:

score: 0
Accepted
time: 88ms
memory: 4544kb

input:

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

output:

RNBNQBKR
RQKNBNRB
BBRQNNKR
BRNQKBRN
NNBBRKRQ
QRBKNBRN
RNBNQBKR
RKBNNQRB
QRBBNNKR
RNBBKNRQ
NNBBRKRQ
NRBKQBRN
RNBNQBKR
RQKNBNRB
BBRQNNKR
BRNQKBRN
NBBRNKRQ
NRBKNBRQ
RNBNQBKR
BNRQKNRB
NNRBKRBQ
BRKRNBNQ
NNBBRKRQ
QRBKNNRB
RNBNQBKR
RQKNBNRB
RKNBBNQR
RNKQNBBR
NNBBRKRQ
NRBKQNRB
RNBNQBKR
BNRQKNRB
RKNBBNRQ
NRB...

result:

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

Test #7:

score: 0
Accepted
time: 88ms
memory: 4320kb

input:

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

output:

RNBNQBKR
RQKNBNRB
BBRQNNKR
QNRBBNKR
NBBRNKRQ
RBBQKRNN
RNBNQBKR
RKBNNQRB
RKQNRBBN
RBNNBKRQ
RBBNKRQN
RNBNQBKR
RKBNNQRB
RKQNRBBN
NBBNRKRQ
RBBNKRNQ
RNBNQBKR
RQKNBNRB
RQNBBNKR
RBQKNRBN
NNBBRKRQ
RBQNKRBN
RNBNQBKR
BNRQKNRB
RKNBBNRQ
NRKNBQRB
NBNRBKRQ
RBNQKRBN
RNBNQBKR
RQKNBNRB
RQNBBNKR
RNBKRQNB
BNNBRKRQ
RBN...

result:

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

Test #8:

score: 0
Accepted
time: 88ms
memory: 4344kb

input:

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

output:

RNBNQBKR
BNRQKNRB
RKNBBNRQ
BNNBRKRQ
NBBNRKRQ
QRNBKNBR
RNBNQBKR
BNRQKNRB
RKNBBNRQ
NRKNBQRB
RNKBNRBQ
NRQBKNBR
RNBNQBKR
BNRQKNRB
QRBBKRNN
QRNBNKBR
BNNBRKRQ
NRNBKQBR
RNBNQBKR
RKBNNQRB
QBRNBNKR
NQRNKBBR
QRNNKBBR
RNBNQBKR
RKBNNQRB
QBRNBNKR
BRNNKBQR
NNBBRKRQ
NRQNKBBR
RNBNQBKR
RQKNBNRB
NNRKRBBQ
NNBBRKRQ
NRN...

result:

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

Test #9:

score: 0
Accepted
time: 85ms
memory: 4488kb

input:

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

output:

RNBNQBKR
RQKNBNRB
BBRQNNKR
NBBNRKQR
BNNBRKRQ
QBBRKNNR
RNBNQBKR
RQKNBNRB
NNRKRBBQ
RNBBNKRQ
NBBRKQNR
RNBNQBKR
RQKNBNRB
BBRQNNKR
NBBNRKQR
BNNBRKRQ
NBBRKNQR
RNBNQBKR
BNRQKNRB
RKNBBNRQ
NRKNBQRB
NBNRBKRQ
QBNRKNBR
RNBNQBKR
BNRQKNRB
RKNBBNRQ
NRBKQNRB
NRNBBKRQ
NBQRKNBR
RNBNQBKR
BNRQKNRB
QRBBKRNN
NBQRBKNR
NNR...

result:

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

Test #10:

score: 0
Accepted
time: 84ms
memory: 4484kb

input:

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

output:

RNBNQBKR
BNRQKNRB
NNRBKRBQ
BBNRKNQR
BBRQNKNR
RNBNQBKR
RKBNNQRB
QBRNBNKR
BBNNRKRQ
BBRNQKNR
RNBNQBKR
RQKNBNRB
BBRQNNKR
NBBNRKRQ
BBRNNKQR
RNBNQBKR
BNRQKNRB
RKNBBNRQ
NRBKQNRB
BNNBRKRQ
BQRBNKNR
RNBNQBKR
RKBNNQRB
NNRQKBBR
BNRBNKRQ
BNRBQKNR
RNBNQBKR
RQKNBNRB
NNRKRBBQ
BNRBNKQR
RNBNQBKR
RQKNBNRB
RQNBBNKR
RNB...

result:

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

Test #11:

score: 0
Accepted
time: 85ms
memory: 4232kb

input:

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

output:

RNBNQBKR
RKBNNQRB
QBRNBNKR
BBNNRKRQ
NNBBRKRQ
RQNBBNKR
RNBNQBKR
NRQNBBKR
RNNKBBRQ
BNNBRKRQ
RNQBBNKR
RNBNQBKR
NRQNBBKR
BBRNQNKR
NRNBBKRQ
RNNBBQKR
RNBNQBKR
NRNQBBKR
BBNNRKRQ
RQNNBBKR
RNBNQBKR
RBBKRNNQ
RNNBBKRQ
RNQNBBKR
RNBNQBKR
NRNQBBKR
RNNQBBKR
RNBNQBKR
RQKNBNRB
BBRQNNKR
NBBNRKRQ
BRQBNNKR
RNBNQBKR
RKB...

result:

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

Extra Test:

score: 0
Extra Test Passed