QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#174040#7186. "Memo" Game With a Hintucup-team008#AC ✓3ms3576kbC++206.3kb2023-09-10 03:53:022023-09-10 03:53:02

Judging History

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

  • [2023-09-10 03:53:02]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3576kb
  • [2023-09-10 03:53:02]
  • 提交

answer

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <complex>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>

using namespace std;

// BEGIN NO SAD
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
typedef vector<int> vi;
#define f first
#define s second
#define derr if(0) cerr
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ", "; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? ", " : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#define debug(x...) cerr << "\e[91m"<<__func__<<":"<<__LINE__<<" [" << #x << "] = ["; _print(x); cerr << "\e[39m" << flush;
// END NO SAD

template<class Fun>
class y_combinator_result {
  Fun fun_;
public:
  template<class T>
  explicit y_combinator_result(T &&fun): fun_(std::forward<T>(fun)) {}

  template<class ...Args>
  decltype(auto) operator()(Args &&...args) {
    return fun_(std::ref(*this), std::forward<Args>(args)...);
  }
};

template<class Fun>
decltype(auto) y_combinator(Fun &&fun) {
  return y_combinator_result<std::decay_t<Fun>>(std::forward<Fun>(fun));
}

template<class T>
bool updmin(T& a, T b) {
  if(b < a) {
    a = b;
    return true;
  }
  return false;
}
template<class T>
bool updmax(T& a, T b) {
  if(b > a) {
    a = b;
    return true;
  }
  return false;
}
typedef int64_t ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

string gen(ll val) {
  ll orig = val;
  string ret = "";
  for(int i = 0; i < 50; i++) {
    if(val%2) ret += "1";
    else ret += "0";
    val /= 2;
  }
  reverse(all(ret));
  return ret;
}
ll gen(string s) {
  ll ret = 0;
  for(auto out: s) {
    ret *= 2;
    ret += out == '1';
  }
  return ret;
}
void rplay() {
  string s;
  cin >> s;
  vector<int> offsets;
  int denom = 35;
  ll base = gen(s);
  while(sz(offsets) < 9) {
    offsets.pb(base % denom);
    base /= denom;
    denom += 2;
  }
  reverse(all(offsets));
  int paired = 0;
  vector<bool> flipped(50);
  for(int i = 0; i < 9; i++) {
    int j = 0;
    while(flipped[j]) j++;
    cout << (j+1) << endl;
    flipped[j] = true;
    string a;
    cin >> a;
    int x = j+1;
    int need = offsets[i];
    string b;
    while(true) {
      if(flipped[x]) {
        x++;
        continue;
      }
      if(need == 0) {
        cout << (x+1) << endl;
        cin >> b;
        flipped[x] = true;
        break;
      }
      else {
        need--;
        x++;
      }
    } 
    if(a[0] != b[0]) while(true);
    paired++;
  }
  map<char, set<int>> seen; // zero indexed
  while(paired < 25) {
    char known = -1;
    for(auto [k, v]: seen) {
      if(sz(v) == 2) {
        known = k;
        break;
      }
    }
    if(known >= 'A' && known <= 'Y') {
      cout << (*seen[known].begin())+1 << endl;
      string a;
      cin >> a;
      if(a == "##") while(true);
      cout << (*seen[known].rbegin())+1 << endl;
      string b;
      cin >> b;
      if(b == "##") while(true);
      if(a[0] != b[0]) while(true);
      paired++;
      flipped[(*seen[known].begin())] = true;
      flipped[(*seen[known].rbegin())] = true;
      seen.erase(known);
    }
    int i = 0;
    while(flipped[i]) i++;
    flipped[i] = true;
    cout << (i+1) << endl;
    string a; cin >> a;
    if(a == "##") while(true);
    if(seen.count(a[0]) && *(seen[a[0]].begin()) != i) {
      cout << *(seen[a[0]].begin())+1 << endl;
      string b;
      cin >> b;
      if(b == "##") while(true);
      if(a[0] != b[0]) while(true);
      seen.erase(a[0]);
      paired++;
    }
    else {
      seen[a[0]].insert(i);
      i++;
      while(flipped[i]) i++;
      flipped[i] = true;
      cout << (i+1) << endl;
      string b; cin >> b;
      if(b == "##") while(true);
      if(b[1] == '+' || b[1] == '!') {
        seen.erase(b[0]);
        paired++;
      }
      else seen[b[0]].insert(i);
    }
  }
}
void play() {
  int t;
  cin >> t;
  while(t--) rplay();
}
void prepare() {
  int t;
  cin >> t;
  while(t--) {
    string s;
    cin >> s;
    ll val = 0;
    int amt = 49;
    set<char> seen;
    for(int i = 0; i < sz(s) && sz(seen) < 9; i++) {
      if(seen.count(s[i])) continue;
      if(i) {
        val *= amt;
        amt -= 2;
      }
      int j = sz(s)-1;
      while(s[j] != s[i]) j--;
      int inc = 0;
      for(int k = i+1; k < j; k++) {
        if(!seen.count(s[k])) inc++;
      }
      val += (inc);
      seen.insert(s[i]);
    }
    string ret = gen(val);
    cout << ret << endl;
    assert(gen(gen(ret)) == ret);
  }
}
void solve() {
  string s;
  cin >> s;
  if(s == "prepare") prepare();
  else {
    assert(s == "play");
    play();
  }
}

// what would chika do
// are there edge cases (N=1?)
// are array sizes proper (scaled by proper constant, for example 2* for koosaga tree)
// integer overflow?
// DS reset properly between test cases
// are you doing geometry in floating points
// are you not using modint when you should

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

First Run Input

prepare
2
ABCDEFGHIJKLMNOPQRSTUVWXYABCDEFGHIJKLMNOPQRSTUVWXY
AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYY

First Run Output

00110011010111000100110010011100100111001011110000
00000000000000000000000000000000000000000000000000

Second Run Input

play
2
00110011010111000100110010011100100111001011110000
A.
A+
B.
B+
C.
C+
D.
D+
E.
E+
F.
F+
G.
G+
H.
H+
I.
I+
J.
K-
L.
M-
N.
O-
P.
Q-
R.
S-
T.
U-
V.
W-
X.
Y-
J.
J+
K.
K+
L.
L+
M.
M+
N.
N+
O.
O+
P.
P+
Q.
Q+
R.
R+
S.
S+
T.
T+
U.
U+
V.
V+
W.
W+
X.
X+
Y.
Y!
00000000000000000000000000000000000000000000...

Second Run Output

1
26
2
27
3
28
4
29
5
30
6
31
7
32
8
33
9
34
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
35
10
36
11
37
12
38
13
39
14
40
15
41
16
42
17
43
18
44
19
45
20
46
21
47
22
48
23
49
24
50
25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
...

result:

ok Correct! The number of the misses is 8 (2 test cases)

Test #2:

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

First Run Input

prepare
1
FNETFOMMJTYCXKCRYLGXKSPAIVQNBURJAPQHUDWSDWVIHGELBO

First Run Output

00000111010111000000100100011000011010001100100011

Second Run Input

play
1
00000111010111000000100100011000011010001100100011
F.
F+
N.
N+
E.
E+
T.
T+
O.
O+
M.
M+
J.
J+
Y.
Y+
C.
C+
X.
K-
R.
L-
G.
X-
X.
X+
K.
K+
S.
P-
A.
I-
V.
Q-
B.
U-
R.
R+
A.
A+
P.
P+
Q.
Q+
H.
U-
U.
U+
D.
W-
S.
S+
D.
D+
W.
W+
V.
V+
I.
I+
H.
H+
G.
G+
L.
L+
B.
B!

Second Run Output

1
5
2
28
3
47
4
10
6
50
7
8
9
32
11
17
12
15
13
14
16
18
19
20
13
20
21
14
22
23
24
25
26
27
29
30
31
16
33
24
34
23
35
27
36
37
30
37
38
39
40
22
41
38
42
39
43
26
44
25
45
36
46
19
48
18
49
29

result:

ok Correct! The number of the misses is 9 (1 test case)

Test #3:

score: 100
Accepted
time: 2ms
memory: 3516kb

First Run Input

prepare
50
FDAVHJWICNELMBTQGPMHCYSTUUKWOYBJNRLGEFXXSIVOAQDRKP
NPBEHYAERLSHAKCMGTQFUYXDVUIWDPBSOXCMFRJOJTNKIGLQWV
AEFGFISMPACJJYRBXUCKNOPEHODITLXWSMGVWBDQKLUQHRYVTN
CKFXOIQOLCSHAGDEUJTYBAVKWPMHDBJNRMFXTEYQUGVNPILWRS
JYIRTLMHQGUUAEDJXTSDCKPCXWPBAWHQRMGNLONVOYEKFVBIFS
IHDCXSWTUHOFXLGLGWJPACUVTBOESDMYAK...

First Run Output

01001101011010010100100001001000000101100110100010
01010111001101000001000010100111100101110100100100
00010001101001001001011010101101100101100111000011
00010001101010110001111101000011001111000010011001
00011111000010100011000111011110100001010001011001
010111001010010000001000011100011010110110011...

Second Run Input

play
50
01001101011010010100100001001000000101100110100010
F.
F+
D.
D+
A.
A+
V.
V+
H.
H+
J.
J+
W.
W+
I.
I+
C.
C+
N.
E-
L.
M-
B.
T-
Q.
G-
P.
M-
M.
M+
Y.
S-
T.
T+
U.
U+
K.
O-
Y.
Y+
B.
B+
N.
N+
R.
L-
L.
L+
G.
G+
E.
E+
X.
X+
S.
S+
O.
O+
Q.
Q+
R.
R+
K.
K+
P.
P!
0101011100110100000100001010011110010111010...

Second Run Output

1
38
2
47
3
45
4
43
5
20
6
32
7
28
8
42
9
21
10
11
12
13
14
15
16
17
18
19
13
19
22
23
24
15
25
26
27
29
30
22
31
14
33
10
34
35
12
35
36
17
37
11
39
40
41
23
44
29
46
16
48
34
49
27
50
18
1
43
2
30
3
31
4
8
5
12
6
22
7
13
9
38
10
47
11
14
15
16
17
18
19
20
21
23
24
25
26
21
27
28
29
24
32
11
33
34
...

result:

ok Correct! The number of the misses is 472 (50 test cases)

Test #4:

score: 100
Accepted
time: 0ms
memory: 3536kb

First Run Input

prepare
75
EAHSMUJLVDPNLEKPCNIICFRTMHYWVSTQBBWRXKFDXOJQUAGGOY
CUWYVQJPSRIDKXMKTFXTFDOJVWLBEMNULIAAPYCHNGHEOGSRQB
UJTQMFLPJRGSECWAHXDCIVRQOIEPANHUBYVGFKMKLDTSWYBNOX
EYOUSDBNEQXIPMFUJCYKJVLSVWOXKLCFWARPBTIHGTMNDRGHAQ
PBHANSDUVHNKYRQVMOBLQAXSEXOLYJRGTWCFKGMWPJIFTIEDCU
YREKISUWLRFFQDIWNUASLJXGMVHBXDMBJT...

First Run Output

00011010111111101110000100001000011110001110111110
01001110111001001011011001110010001010101111100111
00111111001111000010101101011000110101100101011001
00001111010110010011101111010110000101100111100110
01010010100001001010001110100100011011000001100111
010111101100000011111100010110010111011100100...

Second Run Input

play
75
00011010111111101110000100001000011110001110111110
E.
E+
A.
A+
H.
H+
S.
S+
M.
M+
U.
U+
J.
J+
L.
L+
V.
V+
D.
P-
N.
K-
P.
P+
C.
N-
N.
N+
I.
I+
C.
C+
F.
R-
T.
Y-
W.
T-
T.
T+
Q.
B-
B.
B+
W.
W+
R.
R+
X.
K-
K.
K+
F.
F+
D.
D+
X.
X+
O.
Q-
Q.
Q+
G.
G+
O.
O+
Y.
Y!
0100111011100100101101100111001000101...

Second Run Output

1
14
2
46
3
26
4
30
5
25
6
45
7
43
8
13
9
29
10
11
12
15
16
11
17
18
12
18
19
20
21
17
22
23
24
27
28
31
24
31
32
33
34
33
35
28
36
23
37
38
15
38
39
22
40
10
41
37
42
44
32
44
47
48
49
42
50
27
1
39
2
32
3
26
4
38
5
25
6
49
7
24
8
37
9
47
10
11
12
13
14
15
16
13
17
18
19
14
20
17
21
18
22
12
23
27
...

result:

ok Correct! The number of the misses is 688 (75 test cases)

Test #5:

score: 100
Accepted
time: 2ms
memory: 3488kb

First Run Input

prepare
85
RSHXLIARGTANBOIMVCQUCBGQWEDTPMYJWYUFPKESKJODLNFVXH
GEFNCRFLXMNOJGIQPLMSBKHDVIUVCHRAAUYWQBPTWYXSJOTEDK
PNCEFQSMQNOUJPKTWEAHFSRKGCIVJXXLRHLYBWGODVBYDUTAIM
EBFQNGFUKBOYENJSUTTPKPVSIRADCMVRHAHMDCLGLXQXIOJYWW
OSYHICRXEQAMWBDUDWANLLNCVBTXMTGEPJYPGFSKIJFHUKRQOV
SESXRAXOUIGPVJUNLMJFYEBVFCOBDQHKGW...

First Run Output

00001110001010111101011011011011011010000111101101
00011011000100001000001011011111000011110000000110
00011001011111101110110010000101111010111010111010
00010111011000011111010111010010111100110101000110
01100100001011101100110011101101111010010000101101
000000101101111100010111000110101101111111000...

Second Run Input

play
85
00001110001010111101011011011011011010000111101101
R.
R+
S.
S+
H.
H+
X.
X+
L.
L+
I.
I+
A.
A+
G.
G+
T.
T+
N.
B-
O.
M-
V.
C-
Q.
U-
C.
C+
B.
B+
Q.
Q+
W.
E-
D.
P-
M.
M+
Y.
J-
W.
W+
Y.
Y+
U.
U+
F.
P-
P.
P+
K.
E-
E.
E+
K.
K+
J.
J+
O.
O+
D.
D+
N.
N+
F.
F+
V.
V!
0001101100010000100000101101111100001...

Second Run Output

1
8
2
40
3
50
4
49
5
45
6
15
7
11
9
23
10
28
12
13
14
16
17
18
19
20
21
18
22
13
24
19
25
26
27
29
30
16
31
32
33
25
34
31
35
20
36
37
29
37
38
39
26
39
41
38
42
32
43
14
44
27
46
12
47
36
48
17
1
14
2
48
3
7
4
11
5
29
6
31
8
18
9
43
10
19
12
13
15
16
17
20
21
22
23
24
25
26
15
26
27
28
25
28
30
23
...

result:

ok Correct! The number of the misses is 780 (85 test cases)

Test #6:

score: 100
Accepted
time: 2ms
memory: 3456kb

First Run Input

prepare
90
HPBUYCSIRIQTEVJLTDYGMNBEKMSFHNCRXVDAUFQAWPLGJWKOXO
DGTONCNKSQVCREJMUPOGFWIQPALERLASDYBFVIWKXHTMXBJUHY
KODTYFIXXRTNWNCUSLOREEBCUJPABHIDVGLGJMYKWMSQHAPQVF
BGTFHKOEJPGLWJIHPWAYVDKIFXSUUQYTENNVCMDRMOASRBXCLQ
YSJXTDDMCLKFFBOWVRCSHNPTGARXJQPBKMYWUEAUNGEIIQVHOL
QTXVHWNRFUOHCPMGWMLFRSCQKGEIPKEADY...

First Run Output

00111010010010110111000000011010101001110111100100
01000001110011011101100010010000111101010010000010
01010000011100000101111100000010100110111010110011
01011100101011110111101000011101110111111000100000
01000101111111010001101000101100100000101010010011
001011111001101011111100100011001111000111111...

Second Run Input

play
90
00111010010010110111000000011010101001110111100100
H.
H+
P.
P+
B.
B+
U.
U+
Y.
Y+
C.
C+
S.
S+
I.
I+
R.
R+
Q.
T-
E.
V-
J.
L-
T.
T+
D.
G-
M.
N-
E.
E+
K.
M-
M.
M+
F.
N-
N.
N+
X.
V-
V.
V+
D.
D+
A.
F-
F.
F+
Q.
Q+
A.
A+
W.
L-
L.
L+
G.
G+
J.
J+
W.
W+
K.
K+
O.
X-
X.
X+
O.
O!
0100000111001101110110001...

Second Run Output

1
29
2
42
3
23
4
37
5
19
6
31
7
27
8
10
9
32
11
12
13
14
15
16
17
12
18
20
21
22
24
13
25
26
21
26
28
30
22
30
33
34
14
34
35
18
36
38
28
38
39
11
40
36
41
43
16
43
44
20
45
15
46
41
47
25
48
49
33
49
50
48
1
33
2
20
3
43
4
19
5
7
6
12
8
40
9
32
10
24
11
13
14
15
16
17
18
21
22
23
25
18
26
27
28
14
...

result:

ok Correct! The number of the misses is 822 (90 test cases)

Test #7:

score: 100
Accepted
time: 2ms
memory: 3572kb

First Run Input

prepare
95
CXKFQPTEDJGCNSIWIDLVHJBTMEUMLQVYOHGPKNRYOFXRSBUWAA
DKGIBMTPLXOCTJEVQYVUMAFHNXEOCRDPNQHSUGSWAJRIFYBWKL
QHTADVKMABFWXHRLNICEGJOCPXWTYNVMBESJURIODUGFLYSKQP
WPTDMLIIEOWCKYSSREBDBFXNQGVNXAPVJHYLUKUCGHQRAFJMOT
PUYIWXOSXDQNITNCYWFEKGHPLKVJABJQTUSVRMLCEDFMGAOBHR
YFMQKSXVBUIYLCBRDWWNVFHTTMRHUDOGLA...

First Run Output

00010110101011100110000010011101110101001000000001
00111110110011011011100000001111110011110001001011
01100011000110101011100010110011100100001100110100
00010100000101000110100000010111010111010010011000
00101111011101001001111001010110100011000001111111
000101011100010101101010011110000010100001010...

Second Run Input

play
95
00010110101011100110000010011101110101001000000001
C.
C+
X.
X+
K.
K+
F.
F+
Q.
Q+
P.
P+
T.
T+
E.
E+
D.
D+
J.
G-
N.
S-
I.
W-
I.
I+
L.
V-
H.
J-
J.
J+
B.
M-
U.
M-
M.
M+
L.
L+
V.
V+
Y.
O-
H.
H+
G.
G+
N.
N+
R.
Y-
Y.
Y+
O.
O+
R.
R+
S.
S+
B.
B+
U.
U+
W.
W+
A.
A!
0011111011001101101110000000111111001...

Second Run Output

1
12
2
43
3
37
4
42
5
30
6
36
7
24
8
26
9
18
10
11
13
14
15
16
17
15
19
20
21
22
10
22
23
25
27
28
25
28
29
19
31
20
32
33
34
21
35
11
38
13
39
40
32
40
41
33
44
39
45
14
46
23
47
27
48
16
49
50
1
31
2
49
3
38
4
44
5
47
6
21
7
13
8
32
9
50
10
11
12
14
15
16
17
18
19
16
20
22
23
24
25
26
10
26
27
15
...

result:

ok Correct! The number of the misses is 873 (95 test cases)

Test #8:

score: 100
Accepted
time: 2ms
memory: 3464kb

First Run Input

prepare
100
NKXFSXFWWAOBPEJOTMVHIPUKCGQSRLCRHYNVDMETALGIJQUDBY
LQEXDPFVMOMABELGPHCWBJTVCTNYXGRYWJUQKFIHOSNSKAIURD
MBTKVSCAPAXWHBEHUSQOGYJIUVTNEIRPFYQXJORNLFDCMKWDGL
EBBOJXCXNECGAQQALWPPMJVTGSHIORNMHRDFSYUYLFIUVDKWKT
GKOAHWLYQXVKCLRRTCYMFBSQUPDIWIJPVGDFMNAUTSJXHBEEON
EQEDVJGKUIXMCYQTANIHSADKWRNFYBGOT...

First Run Output

01000110001000111011010110011001011011011111100010
00011100101001111101000100001000010100011110100001
01011010101101100010110001010100110000001011100011
00010000110011100110101111101000100001111110000010
01000011100100001100010110011000001100010110111101
000000101001010111001111000011100000110100010...

Second Run Input

play
100
01000110001000111011010110011001011011011111100010
N.
N+
K.
K+
X.
X+
F.
F+
S.
S+
W.
W+
A.
A+
O.
O+
B.
B+
P.
E-
J.
T-
M.
V-
H.
I-
P.
P+
U.
C-
G.
Q-
R.
L-
C.
C+
R.
R+
H.
H+
Y.
V-
V.
V+
D.
M-
M.
M+
E.
E+
T.
T+
L.
L+
G.
G+
I.
I+
J.
J+
Q.
Q+
U.
U+
D.
D+
Y.
Y!
000111001010011111010001000010000101...

Second Run Output

1
35
2
24
3
6
4
7
5
28
8
9
10
41
11
16
12
49
13
14
15
17
18
19
20
21
22
13
23
25
26
27
29
30
31
25
32
29
33
20
34
36
19
36
37
38
18
38
39
14
40
17
42
30
43
26
44
21
45
15
46
27
47
23
48
37
50
34
1
15
2
36
3
14
4
29
5
50
6
17
7
38
8
24
9
11
10
12
13
16
18
19
20
21
13
21
22
23
25
19
26
23
27
28
30
16
...

result:

ok Correct! The number of the misses is 945 (100 test cases)

Test #9:

score: 100
Accepted
time: 2ms
memory: 3576kb

First Run Input

prepare
100
BULRJTVXIHFVSKOMPWMCGENUNYAKIQQXSPBADERWHJCYFDOLGT
FIHEGHKMALOKAVTSYYWTMQJCERQNBLFIOPSBDUCXVNRWJXUGPD
IGMAXBJVQJGTTPKQCFEEUWRSONNSHBRKUPWHCDDYLXFYVLOIMA
FKYUXTNHQBVLPWEOPREKVIMHCOJLXNDGBFUGIRSASJYADMWTCQ
RYIDFMJOWUBQNXLWNCRSSGKTXOHPVKTEPAAFMEILQVBUHJDGCY
SOVMPWQBMWNURDEALASGVNHCYUTOGKTKY...

First Run Output

01000110001011010011001101110000000100010011001111
00111110000011000000110000001010000010101100011100
01100000111001011001001101101100010000111110010100
01000011111001110000101100100111101010010110000000
00100101101010110111010110010011000000011110010010
001001001011010111101010101110101110001010000...

Second Run Input

play
100
01000110001011010011001101110000000100010011001111
B.
B+
U.
U+
L.
L+
R.
R+
J.
J+
T.
T+
V.
V+
X.
X+
I.
I+
H.
F-
S.
K-
O.
M-
P.
W-
M.
M+
C.
G-
E.
N-
N.
N+
Y.
A-
K.
K+
Q.
Q+
S.
S+
P.
P+
A.
A+
D.
E-
E.
E+
W.
W+
H.
H+
C.
C+
Y.
Y+
F.
F+
D.
D+
O.
O+
G.
G!
001111100000110000001100000010100000101011...

Second Run Output

1
35
2
24
3
48
4
39
5
42
6
50
7
12
8
32
9
29
10
11
13
14
15
16
17
18
19
16
20
21
22
23
25
23
26
27
28
14
30
31
33
13
34
17
36
27
37
38
22
38
40
18
41
10
43
20
44
26
45
11
46
37
47
15
49
21
1
31
2
32
3
6
4
25
5
48
7
12
8
21
9
13
10
30
11
14
15
16
17
18
19
20
15
20
22
23
24
26
27
22
28
29
33
11
34
35
...

result:

ok Correct! The number of the misses is 908 (100 test cases)

Test #10:

score: 100
Accepted
time: 3ms
memory: 3536kb

First Run Input

prepare
100
SQROXGJWGXFMMKUNTEIRNLEVAYLHDHQPPBCSJIWFUYVCTADBKO
PKYCKEOOYJVXPWFGVDJBEULHWQTCAHLMAMURBFQGTIXSRISNND
UOOAMTVCCXBSEKWXPGWSRBNYNLIHJYJITFADEHKPRFDMQQVUGL
YEFEDNPRNSWMCWBAKSQQRBGLXKOILXTDAGJUVYUMVHHCJIFOTP
AVXANGTWWEBDESYBMQHOVRXCLFKDIGJSTJPQFYRCHIKMNLOPUU
OJNYRXLJHGGWFMDDMOPKYTHTUAKLNICIE...

First Run Output

01001000100011010000101000011001011110010101111001
00010111001010110100111011011110011111111010111111
01100000100010101101001011010000111011100100001101
01001011100111010001000100000110101010010100011110
00000100111100001100000010101111011101000000101101
001000011100111000110100111111111111010110010...

Second Run Input

play
100
01001000100011010000101000011001011110010101111001
S.
S+
Q.
Q+
R.
R+
O.
O+
X.
X+
G.
G+
J.
J+
W.
W+
F.
F+
M.
M+
K.
U-
N.
T-
E.
I-
N.
N+
L.
E-
E.
E+
V.
A-
Y.
L-
L.
L+
H.
D-
H.
H+
P.
P+
B.
C-
I.
I+
U.
U+
Y.
Y+
V.
V+
C.
C+
T.
T+
A.
A+
D.
D+
B.
B+
K.
K!
000101110010101101001110110111100111111110...

Second Run Output

1
36
2
31
3
20
4
50
5
10
6
9
7
37
8
39
11
40
12
13
14
15
16
17
18
19
21
16
22
23
18
23
24
25
26
27
22
27
28
29
30
28
32
33
34
35
38
19
41
15
42
26
43
24
44
35
45
17
46
25
47
29
48
34
49
14
1
13
2
5
3
9
4
28
6
21
7
8
10
19
11
17
12
43
14
15
16
18
20
22
23
24
25
14
26
27
29
30
24
30
31
23
32
33
29
33
...

result:

ok Correct! The number of the misses is 913 (100 test cases)

Test #11:

score: 100
Accepted
time: 3ms
memory: 3528kb

First Run Input

prepare
100
RGFVPILWOVETBGSLKHKNCHJIOXAMPXNQSWJYUDRBMDAEYFQCTU
OLRHQVCXUYKWSEJPDYTFGKNVCASHMIDPNERUBOQJMBTGAXLIFW
KXYEEFLNYOGBNIUVVDTCRJDSHQISRAUWAQCTWLMPBHMJKXGFPO
BUXYMYPJMVFQKCIDQHEUOTITPKHLORXVGLASAGWDCJSBWNEFRN
TXKFEIVQISUBKTHXRDJCNOMPMGHNDCLPAWVBWUAEQSJRFYGOYL
PSRXNYTOKJMUFUTIRVMKBDXLJBCLFVGHA...

First Run Output

01001110001000110111011101000110000101001110001100
01001101011001110001110011010110110010111111000111
01011100000001011101001101101010110101101011101101
01011000110111111000111101011000011101101010111100
00011001101100110100110111001010101100000110110111
010110111110011011100100101011101111000011100...

Second Run Input

play
100
01001110001000110111011101000110000101001110001100
R.
R+
G.
G+
F.
F+
V.
V+
P.
P+
I.
I+
L.
L+
W.
W+
O.
O+
E.
T-
B.
S-
K.
H-
K.
K+
N.
C-
H.
H+
J.
X-
A.
M-
X.
X+
N.
N+
Q.
S-
S.
S+
J.
J+
Y.
U-
D.
B-
B.
B+
M.
M+
D.
D+
A.
A+
E.
E+
Y.
Y+
Q.
Q+
C.
C+
T.
T+
U.
U!
010011010110011100011100110101101100...

Second Run Output

1
39
2
14
3
46
4
10
5
29
6
24
7
16
8
34
9
25
11
12
13
15
17
18
19
17
20
21
22
18
23
26
27
28
30
26
31
20
32
33
15
33
35
23
36
37
38
40
13
40
41
28
42
38
43
27
44
11
45
36
47
32
48
21
49
12
50
37
1
38
2
47
3
35
4
28
5
39
6
24
7
25
8
46
9
36
10
11
12
13
14
15
16
17
18
10
19
20
21
22
11
22
23
26
27
13
...

result:

ok Correct! The number of the misses is 920 (100 test cases)

Test #12:

score: 100
Accepted
time: 3ms
memory: 3560kb

First Run Input

prepare
100
VJXSDLHVPDTYCWKILGXUIJANAHYSMUWBRRQTCENEPFFOKBGMOQ
BVAFIMQXPHKTKJWSLITNXOEVCFYCOQADGSGDWUPLHNBJRUEMYR
RLPSNKYDCLUMVDTHJYIHWQSGRBNXUFOFAAGEQTKCPVJEWBMOIX
IBFYNHNRSYOHXPGGKBFCSUMOJLUPKVAQMTCLDWREWQDTAVXIEJ
KGRTAINBFADUHILYMBEOPECVXQPDOWWTJSKMGQSVRUHLCNFXYJ
ETFGMNTHGOKBXNMELFBWCARUHICYJRWSX...

First Run Output

00001101010111110110101000000000100011010000100010
01010110111100100110001001001100110100010010010101
00110000100101101100110100001001101110111100001110
01100001001010110101100100011111100101011011110101
01000110101011110001010000111010110101000011110100
000111011000111001100000001101111110010000111...

Second Run Input

play
100
00001101010111110110101000000000100011010000100010
V.
V+
J.
J+
X.
X+
S.
S+
D.
D+
L.
L+
H.
H+
P.
P+
T.
T+
Y.
C-
W.
K-
I.
G-
U.
I-
I.
I+
A.
N-
A.
A+
Y.
Y+
M.
U-
U.
U+
W.
W+
B.
R-
R.
R+
Q.
C-
C.
C+
E.
N-
N.
N+
E.
E+
F.
F+
O.
K-
K.
K+
B.
B+
G.
G+
M.
M+
O.
O+
Q.
Q!
010101101111001001100010010011...

Second Run Output

1
8
2
22
3
19
4
28
5
10
6
17
7
26
9
41
11
36
12
13
14
15
16
18
20
21
16
21
23
24
25
23
27
12
29
30
20
30
31
14
32
33
34
33
35
37
13
37
38
39
24
39
40
38
42
43
44
45
15
45
46
32
47
18
48
29
49
44
50
35
1
43
2
24
3
31
4
26
5
18
6
48
7
30
8
21
9
39
10
11
12
13
11
13
14
15
16
17
19
12
20
22
23
25
27
28
...

result:

ok Correct! The number of the misses is 934 (100 test cases)

Test #13:

score: 100
Accepted
time: 3ms
memory: 3540kb

First Run Input

prepare
100
MOHGEABJDDXQJMYVSPKBWONVTCPLWSQRFEKUNUHTLCXYIAFIGR
LOFDRVYTQJXQHRTKMBHCEVSAUUIFAEXLMOGIKPBYNWNWCJPGSD
EJBMJEYAAUDIPOTXILRCUQSDNKVPRYFCKMLSQGWFTVXOHNBHWG
MHKMCDGVOQRWJBFSKLSGTYUDWOIAIUPCYTQPNEHBNJRAFXXVEL
AVRXEJCFQXWBYTQRSWYHOBUPUNGSDMHILCNLFKJKMDGEOITAPV
IRLQBTAYITACMJROOJHYNHSPBQLNEVWGX...

First Run Output

00011001111110101011000100001111110000100001010110
01000000010000000101011011100101100011111001111110
00001000100001000001111000110100000111111100100111
00000101101101001101010110000000101000100011110111
01100010011111101011001010111000101000000010100000
000011110010110101101111000011011000100011111...

Second Run Input

play
100
00011001111110101011000100001111110000100001010110
M.
M+
O.
O+
H.
H+
G.
G+
E.
E+
A.
A+
B.
B+
J.
J+
D.
D+
X.
Q-
Y.
V-
S.
P-
K.
W-
N.
V-
V.
V+
T.
C-
P.
P+
L.
W-
W.
W+
S.
S+
Q.
Q+
R.
F-
K.
K+
U.
N-
N.
N+
U.
U+
T.
T+
L.
L+
C.
C+
X.
X+
Y.
Y+
I.
F-
F.
F+
I.
I+
R.
R!
010000000100000001010110111001...

Second Run Output

1
14
2
22
3
39
4
49
5
34
6
46
7
20
8
13
9
10
11
12
15
16
17
18
19
21
23
24
16
24
25
26
27
18
28
29
21
29
30
17
31
12
32
33
35
19
36
37
23
37
38
36
40
25
41
28
42
26
43
11
44
15
45
47
33
47
48
45
50
32
1
32
2
34
3
28
4
50
5
14
6
22
7
40
8
15
9
12
10
11
13
16
17
18
19
13
20
21
23
24
25
26
27
29
24
29
...

result:

ok Correct! The number of the misses is 936 (100 test cases)

Test #14:

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

First Run Input

prepare
100
KVKFHJETMUGYIINCNCXOSBTFLAAQERRDPVHJUXWDPQYWOMLSBG
RKGEAFBUDOEJVNHJBSTOAHIWMWKFCPCYYVITXGXQUDLQSNLRMP
VFSDMWJQNEGIOKCAQFCUJHRBPLWLMUPOASHKYETNTXGDXRVBIY
AUELFVXFMCRTRVDAOJQWJKMQLEUKWSHXGIYHNNBOPBTPGCYSDI
MGTWHRVJKOPGAYSEXKCJIQRYPDXNBTEFBOWACHSLINLUVUDQFM
CAVGCIHTJQXHKTPQOLADBJDMGUWYENMLV...

First Run Output

00000011011001101000110000011110100111100001010011
01100001100100100111000011111110110110111110010110
01011111000101011110010001111101111110100110111011
00011110011000001101010001000101100011000001100100
01100101000111101000001011010001111101101101111101
000001101111011000101111110010110001001000001...

Second Run Input

play
100
00000011011001101000110000011110100111100001010011
K.
K+
V.
V+
F.
F+
H.
H+
J.
J+
E.
E+
T.
T+
M.
M+
U.
U+
G.
Y-
I.
I+
N.
C-
N.
N+
C.
C+
X.
O-
S.
B-
L.
A-
A.
A+
Q.
R-
R.
R+
D.
P-
X.
X+
W.
D-
D.
D+
P.
P+
Q.
Q+
Y.
Y+
W.
W+
O.
O+
L.
L+
S.
S+
B.
B+
G.
G!
011000011001001001110000111111101101101111...

Second Run Output

1
3
2
34
4
24
5
35
6
36
7
29
8
23
9
46
10
37
11
12
13
14
15
16
17
15
18
16
19
20
21
22
25
26
27
26
28
30
31
30
32
33
38
19
39
40
32
40
41
33
42
28
43
12
44
39
45
20
47
25
48
21
49
22
50
11
1
48
2
27
3
38
4
11
5
21
6
28
7
17
8
41
9
42
10
12
13
14
15
16
12
16
18
19
20
10
22
15
23
24
25
26
24
26
29
30
...

result:

ok Correct! The number of the misses is 927 (100 test cases)

Test #15:

score: 100
Accepted
time: 0ms
memory: 3460kb

First Run Input

prepare
100
HXKQHJLCSAEPANTBUFWEUTDPXRRDMQGOKMSBFWVCVLONYYIGJI
FHATBVFQWOIECJDGBSLKREDMQYNOTACNMKSJVULXGYIPPURWXH
JVWOTSJAXCAPFURISNLKXYEHWMPIOHGFUQBCRQVMLYEGDBDNTK
TOWIKXQPDRLAHPNUGUNKIRBECJYSQYMEFSDACFLXHVMJGTWBVO
WTBUHJHOXMQNYCGNQBSKUVPFOFGILTXYLARSEDCRVIWAEJMPDK
VHYQVKEJMPWUDBTWSMKIAGTEFGSYDUCCJ...

First Run Output

00000111001101111111101111010110101110001111110000
00001100011110111100110011111010000001101001001110
00001100000000100000110111100111010101000100001011
01011110010100111000000100100011111011011110100110
01010111001100010101001111111110101000111010000000
000010000011111000101011010110111100110100011...

Second Run Input

play
100
00000111001101111111101111010110101110001111110000
H.
H+
X.
X+
K.
K+
Q.
Q+
J.
J+
L.
L+
C.
C+
S.
S+
A.
A+
E.
P-
N.
T-
B.
U-
F.
W-
E.
E+
U.
U+
T.
T+
D.
P-
P.
P+
R.
R+
D.
D+
M.
G-
O.
M-
M.
M+
B.
B+
F.
F+
W.
W+
V.
V+
O.
O+
N.
N+
Y.
Y+
I.
G-
G.
G+
I.
I!
000011000111101111001100111110100000011010...

Second Run Output

1
5
2
25
3
33
4
30
6
49
7
42
8
40
9
35
10
13
11
12
14
15
16
17
18
19
20
11
21
17
22
15
23
24
12
24
26
27
28
23
29
31
32
34
29
34
36
16
37
18
38
19
39
41
43
32
44
14
45
46
47
48
31
48
50
47
1
7
2
50
3
30
4
29
5
17
6
37
8
25
9
48
10
28
11
12
13
14
15
16
18
19
20
21
22
12
23
15
24
26
27
31
13
31
32
27
...

result:

ok Correct! The number of the misses is 937 (100 test cases)

Test #16:

score: 100
Accepted
time: 2ms
memory: 3468kb

First Run Input

prepare
100
SCMKNXOIGSNYXFERVPAEUQHDULFWTCLIRKMJPOHBBYGJTDVQWA
XGAPSFERTQDFUWOJHLRPYNXIOVSBQTJDGCVKKAMCIUBMLNYEHW
OTQJRXSJVDUSNDIPTGYBIRAMWBEFXFCLEKHGMKQAYHOLNPUCVW
GTPJIHXDRBSYWEECOUYLWNLCXPMJFUAAMOGTVDHQRNFVKQKIBS
URSEIOWGQPCNVFDRMNIUJASLAEBBKFYHJYGVMOXDKWTQXPTCHL
ONFBMGMEDKCRRWCKPABJPDIHIYUGWQXSU...

First Run Output

00010001111011001110001100011110011001110010000000
00101101010101010000000011001010100000000010101111
01010110101001110110111000011011101001010000010001
01000110101000010001000001001010010001011000111110
00100110010101101100001111100111010011110011010111
010010101111011100101101111101101000000101110...

Second Run Input

play
100
00010001111011001110001100011110011001110010000000
S.
S+
C.
C+
M.
M+
K.
K+
N.
N+
X.
X+
O.
O+
I.
I+
G.
G+
Y.
F-
E.
R-
V.
P-
A.
E-
E.
E+
U.
Q-
H.
D-
U.
U+
L.
F-
F.
F+
W.
T-
L.
L+
R.
R+
J.
P-
P.
P+
H.
H+
B.
B+
Y.
Y+
J.
J+
T.
T+
D.
D+
V.
V+
Q.
Q+
W.
W+
A.
A!
001011010101010100000000110010101000...

Second Run Output

1
10
2
30
3
35
4
34
5
11
6
13
7
38
8
32
9
43
12
14
15
16
17
18
19
20
15
20
21
22
23
24
25
21
26
27
14
27
28
29
31
26
33
16
36
37
18
37
39
23
40
41
42
12
44
36
45
29
46
24
47
17
48
22
49
28
50
19
1
23
2
33
3
38
4
20
5
27
6
12
7
48
8
19
9
30
10
11
13
14
15
16
17
18
21
22
24
25
15
25
26
28
29
10
31
16
...

result:

ok Correct! The number of the misses is 933 (100 test cases)

Test #17:

score: 100
Accepted
time: 2ms
memory: 3460kb

First Run Input

prepare
100
NNODHVLKIUVAYTXEBRPAPWXGHYJBOMRSSGKFUIQMFWQLTCJEDC
HANGPOYBUGIFVTKOXXWBFRQAJLMYLMPUWCJEREKCVNDSIQSHDT
ORBBPYTLJSQVISIAGHLGUREEOKAXFKYUJQXDMHNCTNCMDWFWPV
GIAKBSRKPITXAVCLFEWDQFVNJJHXOGRMMYDEHUONTBWPUSCQLY
PXIMBIELUQGORGWAKHNJQJBYFTNTKAPDDVVCHOSYLURFMCESXW
GWUXITHXWIKOVQLSENPLYKDNCQPCJFBRM...

First Run Output

00000001000111000010101101111101011011110011000011
01100001011100100111110000110001000111111000001110
00110001000100100100110110010011110110101011000011
00111011000011100000101110001010010000010101011100
00111110110001100111110111010101110001110010110001
010000110110111111110111001101100110011100010...

Second Run Input

play
100
00000001000111000010101101111101011011110011000011
N.
N+
O.
O+
D.
D+
H.
H+
V.
V+
L.
L+
K.
K+
I.
I+
U.
U+
A.
Y-
T.
X-
E.
B-
R.
P-
A.
A+
P.
P+
W.
X-
X.
X+
G.
Y-
Y.
Y+
J.
B-
B.
B+
M.
R-
R.
R+
S.
S+
G.
G+
F.
Q-
M.
M+
F.
F+
W.
W+
Q.
Q+
T.
T+
C.
J-
J.
J+
E.
E+
C.
C!
011000010111001001111100001100...

Second Run Output

1
2
3
29
4
49
5
25
6
11
7
44
8
35
9
38
10
37
12
13
14
15
16
17
18
19
20
12
21
19
22
23
15
23
24
26
13
26
27
28
17
28
30
31
18
31
32
33
34
24
36
39
40
30
41
36
42
22
43
39
45
14
46
47
27
47
48
16
50
46
1
48
2
24
3
42
4
10
5
31
6
16
7
28
8
20
9
32
11
12
13
14
15
17
18
17
19
21
12
21
22
23
25
26
27
29
...

result:

ok Correct! The number of the misses is 926 (100 test cases)