QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#807471#9188. Light Bulbsucup-team00422 827ms3900kbC++237.6kb2024-12-10 00:40:352024-12-10 00:40:36

Judging History

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

  • [2024-12-10 00:40:36]
  • 评测
  • 测评结果:22
  • 用时:827ms
  • 内存:3900kb
  • [2024-12-10 00:40:35]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;

std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());

constexpr bool debug = false;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int N;
    std::cin >> N;
    
    std::vector<std::string> lights(N);
    if (debug) {
        // for (int i = 0; i < N; i++) {
        //     std::cin >> lights[i];
        // }
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                lights[i] += "HV"[rng() % 2];
            }
        }
    }
    
    std::vector<std::array<int, 3>> determined;
    std::vector<std::array<int, 2>> candidates;
    std::vector<int> possible {0};
    
    int cnt[2] {};
    
    std::vector lit(N, std::vector<bool>(N));
    
    std::vector type(N, std::vector<int>(N, -1));
    std::vector candId(N, std::vector<int>(N, -1));
    
    auto calc = [&](const std::vector<std::array<int, 2>> &q, int s) -> int {
        std::vector<bool> row(N), col(N);
        for (auto [x, y] : q) {
            if (type[x][y] != -1) {
                if (type[x][y] == 0) {
                    row[x] = true;
                } else {
                    col[y] = true;
                }
            } else {
                assert(candId[x][y] != -1);
                if (s >> candId[x][y] & 1) {
                    col[y] = true;
                } else {
                    row[x] = true;
                }
            }
        }
        return N * N - std::count(row.begin(), row.end(), false) * std::count(col.begin(), col.end(), false);
    };
    
    int rounds = 0;
    
    while (cnt[0] < N && cnt[1] < N) {
        if (debug) {
            rounds++;
            std::cerr << "candidates : " << candidates.size() << ", possibilities : " << possible.size() << "\n";
            for (auto [x, y] : candidates) {
                std::cerr << "(" << x << ", " << y << ") ";
            }
            std::cerr << "\n";
            for (auto s : possible) {
                for (int i = 0; i < candidates.size(); i++) {
                    std::cerr << (s >> i & 1);
                }
                std::cerr << " ";
            }
            std::cerr << "\n";
            
            int fact = 0;
            for (auto [x, y] : candidates) {
                if (lights[x][y] == 'V') {
                    fact |= 1 << candId[x][y];
                }
            }
            
            assert(std::find(possible.begin(), possible.end(), fact) != possible.end());
        }
        while (possible.size() <= 512) {
            std::array<int, 2> add {-1, -1};
            for (int i = 0; i < N; i++) {
                for (int j = 0; j < N; j++) {
                    if (!lit[i][j] && candId[i][j] == -1) {
                        add = {i, j};
                    }
                }
            }
            if (add[0] == -1) {
                break;
            }
            for (int i = possible.size() - 1; i >= 0; i--) {
                possible.push_back(possible[i] | 1 << candidates.size());
            }
            candId[add[0]][add[1]] = candidates.size();
            candidates.push_back(add);
        }
        
        std::vector<std::array<int, 2>> query;
        int E = 1E9;
        for (int t = 0; t < 512; t++) {
            std::vector<std::array<int, 2>> q;
            for (auto [a, b, c] : determined) {
                if (rng() % 2) {
                    q.push_back({a, b});
                }
            }
            for (auto [a, b] : candidates) {
                if (rng() % 2) {
                    q.push_back({a, b});
                }
            }
            std::map<int, int> freq;
            for (auto s : possible) {
                freq[calc(q, s)]++;
            }
            int ent = 0;
            for (auto [_, c] : freq) {
                ent += c * c;
            }
            if (ent < E) {
                E = ent;
                query = q;
            }
        }
        
        std::cout << "?\n";
        
        std::vector choose(N, std::vector<bool>(N));
        for (auto [a, b] : query) {
            choose[a][b] = true;
        }
        
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                std::cout << choose[i][j];
            }
            std::cout << "\n";
        }
        std::cout.flush();
        
        int result;
        if (debug) {
            std::vector<bool> row(N), col(N);
            for (auto [x, y] : query) {
                if (lights[x][y] == 'H') {
                    row[x] = true;
                } else {
                    col[y] = true;
                }
            }
            result = N * N - std::count(row.begin(), row.end(), false) * std::count(col.begin(), col.end(), false);
            std::cerr << result << "\n";
        } else {
            std::cin >> result;
        }
        
        {
            std::vector<int> newPossible;
            for (auto s : possible) {
                if (debug) {
                    std::cerr << s << " expected : " << calc(query, s) << "\n";
                }
                if (calc(query, s) == result) {
                    newPossible.push_back(s);
                }
            }
            possible = std::move(newPossible);
        }
        
        int maybe[2] {};
        for (auto s : possible) {
            maybe[0] |= ((1 << candidates.size()) - 1) ^ s;
            maybe[1] |= s;
        }
        
        std::vector<std::array<int, 2>> newCand;
        for (int i = 0; i < candidates.size(); i++) {
            auto [x, y] = candidates[i];
            if ((maybe[0] ^ maybe[1]) >> i & 1) {
                if (!lit[x][y]) {
                    int t = maybe[0] >> i & 1 ? 0 : 1;
                    cnt[t]++;
                    type[x][y] = t;
                    if (t == 0) {
                        for (int j = 0; j < N; j++) {
                            lit[x][j] = true;
                        }
                    } else {
                        for (int j = 0; j < N; j++) {
                            lit[j][y] = true;
                        }
                    }
                    determined.push_back({x, y, t});
                }
                candId[x][y] = -1;
            } else {
                candId[x][y] = newCand.size();
                newCand.push_back({x, y});
            }
        }
        
        for (auto &s : possible) {
            int ns = 0;
            for (int i = 0; i < candidates.size(); i++) {
                if (s >> i & 1) {
                    auto [x, y] = candidates[i];
                    if (candId[x][y] != -1) {
                        ns |= 1 << candId[x][y];
                    }
                }
            }
            s = ns;
        }
        
        std::sort(possible.begin(), possible.end());
        possible.erase(std::unique(possible.begin(), possible.end()), possible.end());
        candidates = std::move(newCand);
    }
    
    int t = cnt[0] == N ? 0 : 1;
    std::cout << "!\n";
    
    std::vector choose(N, std::vector<bool>(N));
    for (auto [a, b, c] : determined) {
        if (c == t) {
            choose[a][b] = true;
        }
    }
    
    if (debug) {
        std::cerr << "rounds : " << rounds << "\n";
    }
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            std::cout << choose[i][j];
        }
        std::cout << "\n";
    }
    std::cout.flush();
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 11
Accepted

Test #1:

score: 11
Accepted
time: 18ms
memory: 3588kb

input:

3
6
6

output:

?
111
000
010
?
000
111
100
!
001
001
010

result:

points 1.0 points  1.0 correct, 2 queries

Test #2:

score: 11
Accepted
time: 18ms
memory: 3632kb

input:

3
6
6

output:

?
001
001
011
?
100
110
100
!
000
000
111

result:

points 1.0 points  1.0 correct, 2 queries

Test #3:

score: 11
Accepted
time: 21ms
memory: 3824kb

input:

3
5
7
7
8
5

output:

?
000
010
111
?
010
111
000
?
110
101
000
?
110
110
010
?
101
000
000
!
001
001
001

result:

points 1.0 points  1.0 correct, 5 queries

Test #4:

score: 11
Accepted
time: 21ms
memory: 3732kb

input:

3
8
9
8
3

output:

?
100
101
100
?
111
000
100
?
010
010
111
?
000
000
011
!
010
001
100

result:

points 1.0 points  1.0 correct, 4 queries

Test #5:

score: 11
Accepted
time: 23ms
memory: 3888kb

input:

3
8
7
7
7
9

output:

?
000
111
001
?
010
011
010
?
100
101
100
?
111
000
100
?
001
011
010
!
001
001
001

result:

points 1.0 points  1.0 correct, 5 queries

Test #6:

score: 11
Accepted
time: 20ms
memory: 3716kb

input:

3
9
9

output:

?
111
000
100
?
010
111
010
!
011
100
000

result:

points 1.0 points  1.0 correct, 2 queries

Test #7:

score: 11
Accepted
time: 21ms
memory: 3656kb

input:

3
9
8
5
6

output:

?
111
000
001
?
010
101
010
?
100
111
100
?
101
000
000
!
111
000
000

result:

points 1.0 points  1.0 correct, 4 queries

Test #8:

score: 11
Accepted
time: 26ms
memory: 3652kb

input:

3
7
5
5

output:

?
100
100
101
?
010
000
111
?
001
111
000
!
111
000
000

result:

points 1.0 points  1.0 correct, 3 queries

Test #9:

score: 11
Accepted
time: 25ms
memory: 3656kb

input:

3
7
6
9
5

output:

?
000
001
111
?
011
001
001
?
100
110
100
?
100
010
000
!
100
100
100

result:

points 1.0 points  1.0 correct, 4 queries

Test #10:

score: 11
Accepted
time: 27ms
memory: 3868kb

input:

3
7
8
7
7
8

output:

?
101
100
100
?
111
000
010
?
011
001
001
?
000
111
100
?
000
110
011
!
010
001
010

result:

points 1.0 points  1.0 correct, 5 queries

Test #11:

score: 11
Accepted
time: 29ms
memory: 3628kb

input:

3
7
7
7
8
5
8

output:

?
111
001
000
?
001
001
101
?
100
000
111
?
000
111
001
?
111
000
010
?
110
110
000
!
010
101
000

result:

points 1.0 points  1.0 correct, 6 queries

Test #12:

score: 11
Accepted
time: 26ms
memory: 3628kb

input:

3
7
7
7
7
7

output:

?
111
100
000
?
100
100
101
?
000
010
111
?
110
010
010
?
100
010
110
!
000
110
001

result:

points 1.0 points  1.0 correct, 5 queries

Test #13:

score: 11
Accepted
time: 21ms
memory: 3736kb

input:

3
8
9
7
7
9

output:

?
010
111
000
?
100
101
100
?
001
001
011
?
000
100
111
?
010
001
011
!
010
001
100

result:

points 1.0 points  1.0 correct, 5 queries

Test #14:

score: 11
Accepted
time: 22ms
memory: 3628kb

input:

3
9
7
9

output:

?
010
011
010
?
001
101
001
?
101
100
100
!
010
100
010

result:

points 1.0 points  1.0 correct, 3 queries

Test #15:

score: 11
Accepted
time: 30ms
memory: 3612kb

input:

3
7
7
7
7
7
7

output:

?
010
010
011
?
000
100
111
?
100
100
110
?
101
001
001
?
001
111
000
?
110
100
010
!
001
000
110

result:

points 1.0 points  1.0 correct, 6 queries

Test #16:

score: 11
Accepted
time: 30ms
memory: 3664kb

input:

3
7
7
7
9
7

output:

?
111
000
001
?
001
101
001
?
000
111
010
?
100
100
110
?
110
000
101
!
100
100
001

result:

points 1.0 points  1.0 correct, 5 queries

Test #17:

score: 11
Accepted
time: 28ms
memory: 3668kb

input:

3
7
9
7
7
7
9

output:

?
110
010
010
?
111
000
001
?
000
001
111
?
000
111
001
?
011
001
010
?
010
110
001
!
110
000
001

result:

points 1.0 points  1.0 correct, 6 queries

Subtask #2:

score: 11
Accepted

Dependency #1:

100%
Accepted

Test #18:

score: 11
Accepted
time: 18ms
memory: 3884kb

input:

3
6
6

output:

?
111
010
000
?
000
100
111
!
001
010
001

result:

points 1.0 points  1.0 correct, 2 queries

Test #19:

score: 11
Accepted
time: 18ms
memory: 3644kb

input:

3
6
6

output:

?
101
100
100
?
010
011
010
!
001
000
110

result:

points 1.0 points  1.0 correct, 2 queries

Test #20:

score: 11
Accepted
time: 23ms
memory: 3688kb

input:

3
7
8
7
9
8

output:

?
111
100
000
?
100
100
110
?
000
111
100
?
001
011
001
?
110
010
100
!
001
100
001

result:

points 1.0 points  1.0 correct, 5 queries

Test #21:

score: 11
Accepted
time: 21ms
memory: 3656kb

input:

3
5
7
7
7
7

output:

?
001
001
011
?
100
110
100
?
000
111
001
?
010
000
111
?
110
000
011
!
100
010
010

result:

points 1.0 points  1.0 correct, 5 queries

Test #22:

score: 11
Accepted
time: 28ms
memory: 3652kb

input:

3
7
7
8
7
6

output:

?
010
000
111
?
010
110
010
?
001
111
000
?
100
101
100
?
101
000
011
!
001
001
001

result:

points 1.0 points  1.0 correct, 5 queries

Test #23:

score: 11
Accepted
time: 21ms
memory: 3852kb

input:

3
9
7
9

output:

?
000
111
010
?
100
100
011
?
111
000
100
!
010
101
000

result:

points 1.0 points  1.0 correct, 3 queries

Test #24:

score: 11
Accepted
time: 18ms
memory: 3592kb

input:

3
8
9
7
8

output:

?
010
010
110
?
111
010
000
?
010
111
000
?
001
110
101
!
011
000
100

result:

points 1.0 points  1.0 correct, 4 queries

Test #25:

score: 11
Accepted
time: 25ms
memory: 3644kb

input:

3
7
5
5

output:

?
001
101
001
?
010
111
000
?
100
000
111
!
111
000
000

result:

points 1.0 points  1.0 correct, 3 queries

Test #26:

score: 11
Accepted
time: 17ms
memory: 3664kb

input:

3
9
6

output:

?
100
100
110
?
010
010
011
!
100
100
100

result:

points 1.0 points  1.0 correct, 2 queries

Test #27:

score: 11
Accepted
time: 22ms
memory: 3652kb

input:

3
7
5
7
7

output:

?
100
000
111
?
100
101
100
?
001
011
001
?
011
010
001
!
010
001
010

result:

points 1.0 points  1.0 correct, 4 queries

Test #28:

score: 11
Accepted
time: 29ms
memory: 3600kb

input:

3
7
7
7
9

output:

?
010
010
110
?
000
001
111
?
101
001
001
?
000
101
110
!
000
101
010

result:

points 1.0 points  1.0 correct, 4 queries

Test #29:

score: 11
Accepted
time: 18ms
memory: 3604kb

input:

3
9
7
8
9

output:

?
000
111
001
?
001
000
111
?
111
000
010
?
101
101
100
!
000
110
001

result:

points 1.0 points  1.0 correct, 4 queries

Test #30:

score: 11
Accepted
time: 30ms
memory: 3660kb

input:

3
7
7
7
8
9
8

output:

?
110
100
100
?
111
001
000
?
101
001
001
?
010
010
011
?
100
001
101
?
010
100
011
!
000
110
001

result:

points 1.0 points  1.0 correct, 6 queries

Test #31:

score: 11
Accepted
time: 26ms
memory: 3732kb

input:

3
7
7
7
9
8

output:

?
100
100
110
?
000
001
111
?
010
111
000
?
101
001
100
?
001
011
001
!
001
001
100

result:

points 1.0 points  1.0 correct, 5 queries

Test #32:

score: 11
Accepted
time: 20ms
memory: 3816kb

input:

3
8
7
7
7
6

output:

?
100
000
111
?
010
010
011
?
001
001
101
?
001
111
000
?
010
100
110
!
100
010
001

result:

points 1.0 points  1.0 correct, 5 queries

Test #33:

score: 11
Accepted
time: 21ms
memory: 3660kb

input:

3
9
8
9

output:

?
011
001
001
?
100
111
100
?
100
100
011
!
100
001
001

result:

points 1.0 points  1.0 correct, 3 queries

Test #34:

score: 11
Accepted
time: 29ms
memory: 3736kb

input:

3
7
7
9
8

output:

?
111
100
000
?
100
100
110
?
100
000
111
?
011
110
000
!
000
100
011

result:

points 1.0 points  1.0 correct, 4 queries

Test #35:

score: 11
Accepted
time: 436ms
memory: 3596kb

input:

10
10
20
20
20
20
30
20
60
60
60
90

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111110
0000000001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 11 queries

Test #36:

score: 11
Accepted
time: 34ms
memory: 3684kb

input:

10
100

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
!
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111

result:

points 1.0 points  1.0 correct, 1 queries

Test #37:

score: 11
Accepted
time: 518ms
memory: 3896kb

input:

10
10
28
20
46
50
60
60
68
60
73
76
70
73

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1011111111
0000000001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 13 queries

Test #38:

score: 11
Accepted
time: 628ms
memory: 3604kb

input:

10
46
36
51
37
44
51
65
76
52
65
46
52
82
76
94
68

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1011111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
1101001111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 16 queries

Test #39:

score: 11
Accepted
time: 620ms
memory: 3860kb

input:

10
19
36
44
36
51
51
52
55
60
68
72
68
93
52
50
86
90
85

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1110111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000011111
0101101000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 18 queries

Test #40:

score: 11
Accepted
time: 612ms
memory: 3892kb

input:

10
46
36
51
37
55
72
58
58
70
70
76
85
76
86
80
88
100

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
0010111101
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 17 queries

Test #41:

score: 11
Accepted
time: 465ms
memory: 3620kb

input:

8
34
44
44
29
40
39
48
46
55
58
52
44
40

output:

?
00000000
00000000
00000000
00000000
00000000
00000000
00000001
11111110
?
00000000
00000000
00000000
00000000
00000000
00000010
00000010
11111011
?
00000000
00000000
00000000
00000000
00011110
00000001
00000000
10101001
?
00000000
00000000
00000000
00000000
11100010
00000000
00000000
00001001
?
00...

result:

points 1.0 points  1.0 correct, 13 queries

Test #42:

score: 11
Accepted
time: 94ms
memory: 3892kb

input:

10
90
70
37
68
73

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1110111111
?
0001000000
0001000000
0001000000
0001000000
0001000000
0001000000
0001000000
0001000000
0001000000
0001011100
?
0001000000
0000000000
0001000000
0000000000
0001000000
0001000000
00000000...

result:

points 1.0 points  1.0 correct, 5 queries

Test #43:

score: 11
Accepted
time: 340ms
memory: 3636kb

input:

9
53
49
51
39
74
61
63
66
81
67
60
66

output:

?
000000000
000000000
000000000
000000000
000000000
000000000
000000000
000000001
111111011
?
000000000
000000000
000000000
000000000
000000000
000000000
000000001
000000000
011100111
?
000000000
000000000
000000000
000000000
000000000
000000000
000111111
000000001
101000000
?
000000000
000000000
00...

result:

points 1.0 points  1.0 correct, 12 queries

Test #44:

score: 11
Accepted
time: 307ms
memory: 3612kb

input:

10
82
60
76
76
82
88
86
72
90

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000010111
1010001000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 9 queries

Test #45:

score: 11
Accepted
time: 234ms
memory: 3800kb

input:

10
73
46
50
55
72
79
84
85

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1011111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
0110101001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 8 queries

Test #46:

score: 11
Accepted
time: 79ms
memory: 3616kb

input:

10
90
37
73

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1101111111
?
0010000000
0010000000
0010000000
0010000000
0010000000
0010000000
0010000000
0010000000
0010000000
0010000110
?
0000000000
0010000000
0010000000
0000000000
0000000000
0000000000
00100000...

result:

points 1.0 points  1.0 correct, 3 queries

Test #47:

score: 11
Accepted
time: 261ms
memory: 3672kb

input:

10
91
91
64
82
86
82
86

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000111111
1111000001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 7 queries

Test #48:

score: 11
Accepted
time: 397ms
memory: 3676kb

input:

10
10
10
10
30
20
60
30
30
50
93
82

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
0000000000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 11 queries

Test #49:

score: 11
Accepted
time: 281ms
memory: 3600kb

input:

10
10
20
30
20
30
40
92
76
84
88

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111101111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
0000010000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 10 queries

Test #50:

score: 11
Accepted
time: 284ms
memory: 3892kb

input:

10
10
20
20
30
84
85
70

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111110
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111110
0000000001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 7 queries

Test #51:

score: 11
Accepted
time: 250ms
memory: 3616kb

input:

10
82
82
70
64
86
82
80
86
58

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111011111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000011111
1111010000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 9 queries

Test #52:

score: 11
Accepted
time: 173ms
memory: 3668kb

input:

10
82
60
73
82
84
98
82
88

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000011111
1000000000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 8 queries

Test #53:

score: 11
Accepted
time: 250ms
memory: 3692kb

input:

10
82
73
76
76
73
84
84
84
90

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111011111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000011111
1011000100
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 9 queries

Test #54:

score: 11
Accepted
time: 239ms
memory: 3672kb

input:

10
10
82
64
70
68
82
75
68

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111011111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111110111
0000100000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000001000
00000010...

result:

points 1.0 points  1.0 correct, 8 queries

Test #55:

score: 11
Accepted
time: 383ms
memory: 3664kb

input:

10
82
55
60
68
84
86
86
68
82
88
90
51

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000001111
0111010000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 12 queries

Test #56:

score: 11
Accepted
time: 560ms
memory: 3896kb

input:

10
10
20
20
20
20
80
82
58
58
68
51
88
82
85
91
92
65

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111101
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
0000000010
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 17 queries

Test #57:

score: 11
Accepted
time: 506ms
memory: 3676kb

input:

10
55
36
55
58
52
52
64
72
85
72
75
95
76
79
60
80

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111011111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
1011111000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 16 queries

Test #58:

score: 11
Accepted
time: 653ms
memory: 3704kb

input:

10
46
52
68
60
65
60
60
65
76
82
85
58
65
79
88
76
93
80
82

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1101111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
1110110011
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 19 queries

Test #59:

score: 11
Accepted
time: 437ms
memory: 3812kb

input:

10
55
55
52
60
65
65
65
76
72
93
65
60
72
64

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111101
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
1111100010
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 14 queries

Test #60:

score: 11
Accepted
time: 549ms
memory: 3744kb

input:

10
55
37
73
55
46
37
58
85
86
88
93
79
68
82
85
82

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
0101011011
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 16 queries

Test #61:

score: 11
Accepted
time: 465ms
memory: 3672kb

input:

10
10
28
36
28
20
52
55
55
64
30
28
82
82
37

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111110
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111011111
0000000001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 14 queries

Test #62:

score: 11
Accepted
time: 155ms
memory: 3676kb

input:

10
82
64
82
70
91

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1110111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000011111
0011000100
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 5 queries

Test #63:

score: 11
Accepted
time: 106ms
memory: 3824kb

input:

9
73
49
45

output:

?
000000000
000000000
000000000
000000000
000000000
000000000
000000000
000000001
111111101
?
000000000
000000000
000000000
000000000
000000010
000000010
000000011
000000010
101010010
?
000000000
000000010
000000010
000000010
000000011
000000000
000000010
000000000
101000110
!
000000000
000000000
00...

result:

points 1.0 points  1.0 correct, 3 queries

Test #64:

score: 11
Accepted
time: 405ms
memory: 3664kb

input:

9
25
25
25
27
46
53
53
57
67
73
72

output:

?
000000000
000000000
000000000
000000000
000000000
000000000
000000000
000000001
111111111
?
000000000
000000000
000000000
000000000
000000000
000000000
000000000
000111111
000000001
?
000000000
000000000
000000000
000000000
000000000
000000000
000000000
111011111
000000010
?
000000000
000000000
00...

result:

points 1.0 points  1.0 correct, 11 queries

Test #65:

score: 11
Accepted
time: 53ms
memory: 3740kb

input:

8
64
36

output:

?
00000000
00000000
00000000
00000000
00000000
00000000
00000001
11111111
?
00000001
00000000
00000001
00000001
00000001
00000001
00000011
10001100
!
00000000
00000000
00000000
00000000
00000000
00000001
00000000
11111110

result:

points 1.0 points  1.0 correct, 2 queries

Test #66:

score: 11
Accepted
time: 305ms
memory: 3892kb

input:

8
22
22
22
24
36
43
48
40
50
56
57

output:

?
00000000
00000000
00000000
00000000
00000000
00000000
00000010
11111111
?
00000000
00000000
00000000
00000000
00000000
00000000
00111110
00000010
?
00000000
00000000
00000000
00000000
00000000
00000000
11000011
00010000
?
00000000
00000000
00000000
00000000
00000000
00000010
10001100
01000100
?
00...

result:

points 1.0 points  1.0 correct, 11 queries

Test #67:

score: 11
Accepted
time: 37ms
memory: 3892kb

input:

7
49

output:

?
0000000
0000000
0000000
0000000
0000000
0000001
1111110
!
0000000
0000000
0000000
0000000
0000000
0000001
1111110

result:

points 1.0 points  1.0 correct, 1 queries

Test #68:

score: 11
Accepted
time: 285ms
memory: 3600kb

input:

7
19
19
25
34
29
31
42
49
43
28

output:

?
0000000
0000000
0000000
0000000
0000000
0000001
1111111
?
0000000
0000000
0000000
0000000
0000000
0111111
0000001
?
0000000
0000000
0000000
0000000
0000001
0100100
1000011
?
0000000
0000000
0000000
0000010
0000010
0011010
0110011
?
0000000
0000000
0000000
0001000
0000011
1011001
0110001
?
0000000
...

result:

points 1.0 points  1.0 correct, 10 queries

Test #69:

score: 11
Accepted
time: 644ms
memory: 3616kb

input:

10
46
46
46
52
51
36
58
52
70
58
65
73
58
73
84
65
88
76
58
76
65

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111011
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
1010101111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 21 queries

Test #70:

score: 11
Accepted
time: 571ms
memory: 3632kb

input:

10
10
10
30
30
37
46
28
46
64
60
52
79
70
82
65
88
60

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1101111111
0000000000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 17 queries

Test #71:

score: 11
Accepted
time: 279ms
memory: 3668kb

input:

10
82
44
55
52
64
76
76
94

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111101111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000011111
1011000000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 8 queries

Test #72:

score: 11
Accepted
time: 565ms
memory: 3676kb

input:

10
55
37
46
68
58
68
70
76
72
85
85
86
82
88
80

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111101
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
1011010110
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 15 queries

Test #73:

score: 11
Accepted
time: 308ms
memory: 3740kb

input:

10
73
64
52
60
65
58
72
75
76
85

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
1010101111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 10 queries

Test #74:

score: 11
Accepted
time: 725ms
memory: 3732kb

input:

10
19
36
28
36
51
51
36
52
46
58
58
70
80
70
79
72
70
92
82
84

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1110111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000011111
1011100010
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 20 queries

Test #75:

score: 11
Accepted
time: 389ms
memory: 3892kb

input:

10
55
55
55
60
60
60
73
70
82
79
75
75

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1101111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
0111110010
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 12 queries

Test #76:

score: 11
Accepted
time: 160ms
memory: 3664kb

input:

5
17
16
19
17
17
17
22
25
22

output:

?
00000
00000
00000
00010
11111
?
00000
00000
00101
11111
00010
?
00000
00100
01101
00100
00100
?
00000
01000
01100
01101
01000
?
00100
00001
00001
01001
10001
?
11001
00000
10000
00010
00000
?
11101
01000
01000
00010
00100
?
11100
10100
00000
00010
10101
?
10000
10000
00100
00011
01000
!
00100
0010...

result:

points 1.0 points  1.0 correct, 9 queries

Subtask #3:

score: 0
Time Limit Exceeded

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #77:

score: 78
Accepted
time: 18ms
memory: 3604kb

input:

3
6
6

output:

?
010
111
000
?
100
000
111
!
010
001
001

result:

points 1.0 points  1.0 correct, 2 queries

Test #78:

score: 78
Accepted
time: 17ms
memory: 3656kb

input:

3
9
9
9
3

output:

?
010
111
000
?
111
000
010
?
010
010
101
?
000
010
010
!
000
101
010

result:

points 1.0 points  1.0 correct, 4 queries

Test #79:

score: 78
Accepted
time: 30ms
memory: 3652kb

input:

3
7
7
7
9
8
7

output:

?
110
010
010
?
111
000
010
?
001
111
000
?
001
001
011
?
100
111
100
?
111
000
101
!
001
001
001

result:

points 1.0 points  1.0 correct, 6 queries

Test #80:

score: 78
Accepted
time: 23ms
memory: 3884kb

input:

3
7
5
8
7
7

output:

?
010
110
010
?
001
111
000
?
100
011
100
?
100
000
111
?
010
010
011
!
100
010
010

result:

points 1.0 points  1.0 correct, 5 queries

Test #81:

score: 78
Accepted
time: 22ms
memory: 3732kb

input:

3
8
7
9
8

output:

?
100
111
000
?
010
110
010
?
001
001
011
?
110
000
101
!
100
001
010

result:

points 1.0 points  1.0 correct, 4 queries

Test #82:

score: 78
Accepted
time: 22ms
memory: 3664kb

input:

3
9
7
9
5

output:

?
111
000
001
?
000
001
111
?
000
111
001
?
001
001
100
!
110
001
000

result:

points 1.0 points  1.0 correct, 4 queries

Test #83:

score: 78
Accepted
time: 22ms
memory: 3664kb

input:

3
8
7
9
9

output:

?
001
001
101
?
000
111
001
?
111
000
010
?
011
111
000
!
011
000
100

result:

points 1.0 points  1.0 correct, 4 queries

Test #84:

score: 78
Accepted
time: 20ms
memory: 3880kb

input:

3
9
6

output:

?
111
010
000
?
000
111
010
!
111
000
000

result:

points 1.0 points  1.0 correct, 2 queries

Test #85:

score: 78
Accepted
time: 20ms
memory: 3604kb

input:

3
9
6

output:

?
101
100
100
?
011
001
001
!
100
100
100

result:

points 1.0 points  1.0 correct, 2 queries

Test #86:

score: 78
Accepted
time: 27ms
memory: 3668kb

input:

3
7
9
7
8
9

output:

?
001
001
101
?
000
010
111
?
010
111
000
?
011
110
000
?
010
110
010
!
000
010
101

result:

points 1.0 points  1.0 correct, 5 queries

Test #87:

score: 78
Accepted
time: 22ms
memory: 3652kb

input:

3
8
7
9
9

output:

?
011
001
001
?
001
000
111
?
100
110
100
?
000
101
110
!
010
101
000

result:

points 1.0 points  1.0 correct, 4 queries

Test #88:

score: 78
Accepted
time: 21ms
memory: 3660kb

input:

3
7
5
5

output:

?
000
010
111
?
010
010
110
?
100
100
110
!
000
110
001

result:

points 1.0 points  1.0 correct, 3 queries

Test #89:

score: 78
Accepted
time: 25ms
memory: 3608kb

input:

3
7
5
9
5

output:

?
001
001
101
?
001
000
111
?
001
111
001
?
111
000
001
!
010
001
010

result:

points 1.0 points  1.0 correct, 4 queries

Test #90:

score: 78
Accepted
time: 23ms
memory: 3628kb

input:

3
7
8
7
9
9
5

output:

?
000
010
111
?
110
010
010
?
010
111
000
?
001
001
101
?
110
111
100
?
000
011
000
!
001
001
010

result:

points 1.0 points  1.0 correct, 6 queries

Test #91:

score: 78
Accepted
time: 23ms
memory: 3612kb

input:

3
8
7
7
9
8

output:

?
100
111
000
?
010
011
010
?
001
101
001
?
001
000
111
?
101
010
100
!
000
001
110

result:

points 1.0 points  1.0 correct, 5 queries

Test #92:

score: 78
Accepted
time: 23ms
memory: 3652kb

input:

3
7
9
8
7
7

output:

?
100
000
111
?
100
100
110
?
011
010
010
?
000
111
100
?
000
110
010
!
100
100
010

result:

points 1.0 points  1.0 correct, 5 queries

Test #93:

score: 78
Accepted
time: 21ms
memory: 3900kb

input:

3
9
7
9

output:

?
010
111
000
?
111
000
010
?
100
000
111
!
000
101
010

result:

points 1.0 points  1.0 correct, 3 queries

Test #94:

score: 78
Accepted
time: 471ms
memory: 3664kb

input:

10
10
20
10
40
40
30
30
20
60
70
60
60

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111101111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
0000010000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 12 queries

Test #95:

score: 78
Accepted
time: 80ms
memory: 3868kb

input:

10
90
60

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111011111
?
0000100000
0000100000
0000100000
0000100000
0000100000
0000100000
0000000000
0000100000
0000100000
0111100011
!
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 2 queries

Test #96:

score: 78
Accepted
time: 433ms
memory: 3740kb

input:

10
10
20
20
30
20
64
64
64
46
64
60
91

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111110
1000000000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 12 queries

Test #97:

score: 78
Accepted
time: 766ms
memory: 3676kb

input:

10
46
28
44
36
44
44
44
51
51
52
64
46
60
44
55
73
64
68
60
72
72
55
68

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111011
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
1100011111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 23 queries

Test #98:

score: 78
Accepted
time: 827ms
memory: 3704kb

input:

10
19
36
36
44
51
64
52
36
58
58
68
72
58
65
58
70
60
68
94
65
75
70

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000011111
1111111000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 22 queries

Test #99:

score: 78
Accepted
time: 713ms
memory: 3864kb

input:

10
46
44
65
36
46
58
51
36
68
76
70
60
58
76
72
70
72
88
85
82
84
79

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
0001111101
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 22 queries

Test #100:

score: 78
Accepted
time: 272ms
memory: 3616kb

input:

8
40
34
40
39
34
46
39
64
56
46

output:

?
00000000
00000000
00000000
00000000
00000000
00000000
00000010
11111111
?
00000000
00000000
00000000
00000000
00000000
00000011
00000001
11111100
?
00000000
00000000
00000000
00000000
00000000
00110100
00000001
10000011
?
00000000
00000000
00000000
00000000
00000000
11001101
00000001
00100010
?
00...

result:

points 1.0 points  1.0 correct, 10 queries

Test #101:

score: 78
Accepted
time: 208ms
memory: 3608kb

input:

10
91
68
73
65
58
92

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000111111
1101010001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 6 queries

Test #102:

score: 78
Accepted
time: 526ms
memory: 3636kb

input:

9
53
46
66
45
41
57
63
51
56
60
61
63
69
61
57
63
61

output:

?
000000000
000000000
000000000
000000000
000000000
000000000
000000000
000000001
101111110
?
000000000
000000000
000000000
000000000
000000000
000000000
000000100
000000000
110011101
?
000000000
000000000
000000000
000000000
000000000
000000001
000000011
000000001
011101111
?
000000000
000000000
00...

result:

points 1.0 points  1.0 correct, 17 queries

Test #103:

score: 78
Accepted
time: 224ms
memory: 3728kb

input:

10
73
60
64
60
76
72
82

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111011
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
1110011110
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 7 queries

Test #104:

score: 78
Accepted
time: 312ms
memory: 3660kb

input:

10
73
55
64
68
68
100
84
86
91
65

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000100
1101110110
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 10 queries

Test #105:

score: 78
Accepted
time: 78ms
memory: 3664kb

input:

10
90
64
90

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1101111111
?
0010000000
0010000000
0010000000
0010000000
0010000000
0010000000
0000000000
0010000000
0010000000
1110001101
?
0010000000
0000000000
0000000000
0010000000
0000000000
0000000000
00100000...

result:

points 1.0 points  1.0 correct, 3 queries

Test #106:

score: 78
Accepted
time: 182ms
memory: 3660kb

input:

10
82
64
76
91
76
92

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111110
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000011110
1000100001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 6 queries

Test #107:

score: 78
Accepted
time: 424ms
memory: 3612kb

input:

10
10
20
30
20
20
30
20
20
60
55
79
80
72

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111110
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
0000000001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 13 queries

Test #108:

score: 78
Accepted
time: 502ms
memory: 3744kb

input:

10
10
10
20
20
20
60
60
46
80
75
76
55
58
82
79
92

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111110111
0000000000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 16 queries

Test #109:

score: 78
Accepted
time: 299ms
memory: 3616kb

input:

10
10
20
30
30
73
76
76
70

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1101111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0110111111
0010000000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 8 queries

Test #110:

score: 78
Accepted
time: 80ms
memory: 3604kb

input:

10
90
100

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
?
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1100110011
!
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
10000000...

result:

points 1.0 points  1.0 correct, 2 queries

Test #111:

score: 78
Accepted
time: 80ms
memory: 3868kb

input:

10
90
92
84

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1011111111
?
0000000000
0100000000
0100000000
0100000000
0100000000
0100000000
0100000000
0100000000
0100000000
0100110000
?
0100000000
0000000000
0000000000
0100000000
0100000000
0100000000
00000000...

result:

points 1.0 points  1.0 correct, 3 queries

Test #112:

score: 78
Accepted
time: 318ms
memory: 3728kb

input:

10
82
64
84
82
76
82
88
64
84

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111011111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000011110
0001100001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 9 queries

Test #113:

score: 78
Accepted
time: 272ms
memory: 3744kb

input:

10
10
82
79
76
85
82
92
85

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111110111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111101
0000001000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
10000000...

result:

points 1.0 points  1.0 correct, 8 queries

Test #114:

score: 78
Accepted
time: 439ms
memory: 3664kb

input:

10
73
52
72
64
68
86
86
86
88
70
94
82
64

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111011
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
0100101110
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 13 queries

Test #115:

score: 78
Accepted
time: 418ms
memory: 3740kb

input:

10
10
20
20
20
30
80
90
70
58
64
72
76
70

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1101111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111110111
0010000000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 13 queries

Test #116:

score: 78
Accepted
time: 572ms
memory: 3664kb

input:

10
55
55
44
52
76
76
79
68
72
75
68
84
84
70
88
84

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111110111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
0101111001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 16 queries

Test #117:

score: 78
Accepted
time: 556ms
memory: 3620kb

input:

10
55
36
68
46
64
58
76
72
84
76
79
75
88
76
80
79
72
72

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111011
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
1100011101
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 18 queries

Test #118:

score: 78
Accepted
time: 475ms
memory: 3896kb

input:

10
64
46
55
52
36
55
73
60
64
68
70
79
85
85
93
64

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
1001010111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 16 queries

Test #119:

score: 78
Accepted
time: 490ms
memory: 3616kb

input:

10
55
37
64
64
60
72
84
72
68
88
72
79
85

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
0011011101
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 13 queries

Test #120:

score: 78
Accepted
time: 531ms
memory: 3728kb

input:

10
19
28
19
28
51
55
60
52
44
60
60
60
72
37
90

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000111111
0111000000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 15 queries

Test #121:

score: 78
Accepted
time: 232ms
memory: 3616kb

input:

10
82
82
82
84
93
90
76

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111101
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000011111
1101100000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 7 queries

Test #122:

score: 78
Accepted
time: 53ms
memory: 3596kb

input:

9
81
57
45

output:

?
000000000
000000000
000000000
000000000
000000000
000000000
000000000
000000001
111111111
?
000000001
000000001
000000001
000000001
000000001
000000001
000000001
000000001
110011011
?
000000000
000000000
000000001
000000001
000000001
000000000
000000001
000000001
011010100
!
000000000
000000000
00...

result:

points 1.0 points  1.0 correct, 3 queries

Test #123:

score: 78
Accepted
time: 351ms
memory: 3720kb

input:

9
18
25
41
41
41
46
57
45
45
72

output:

?
000000000
000000000
000000000
000000000
000000000
000000000
000000000
000000001
111111110
?
000000000
000000000
000000000
000000000
000000000
000000000
111110111
000000000
000000001
?
000000000
000000000
000000000
000000000
000000000
000000010
100011101
000000001
000000010
?
000000000
000000000
00...

result:

points 1.0 points  1.0 correct, 10 queries

Test #124:

score: 78
Accepted
time: 111ms
memory: 3896kb

input:

8
57
52
43

output:

?
00000000
00000000
00000000
00000000
00000000
00000000
00000001
11101111
?
00000000
00000000
00000000
00000000
00000001
00000001
00010011
01101101
?
00000000
00000000
00010000
00000000
00010001
00000000
00010010
01111000
!
00000000
00000000
00000000
00000000
00000001
00000000
00000000
11111110

result:

points 1.0 points  1.0 correct, 3 queries

Test #125:

score: 78
Accepted
time: 408ms
memory: 3720kb

input:

8
22
22
22
34
29
29
32
43
43
43
56
43

output:

?
00000000
00000000
00000000
00000000
00000000
00000000
00000001
11111111
?
00000000
00000000
00000000
00000000
00000000
00000000
00110011
00000001
?
00000000
00000000
00000000
00000000
00000000
00000000
11001111
00001000
?
00000000
00000000
00000000
00000000
00000000
00000010
00010110
00001011
?
00...

result:

points 1.0 points  1.0 correct, 12 queries

Test #126:

score: 78
Accepted
time: 52ms
memory: 3716kb

input:

7
49
34
21

output:

?
0000000
0000000
0000000
0000000
0000000
0000001
1111111
?
0000001
0000001
0000001
0000001
0000001
0000111
1001001
?
0000001
0000001
0000000
0000000
0000001
0000101
0001000
!
0000000
0000000
0000000
0000000
0000000
0000001
1111110

result:

points 1.0 points  1.0 correct, 3 queries

Test #127:

score: 78
Accepted
time: 275ms
memory: 3868kb

input:

7
19
14
24
31
35
43
41
25

output:

?
0000000
0000000
0000000
0000000
0000000
0000100
1110111
?
0000000
0000000
0000000
0000000
0000000
0111101
0001000
?
0000000
0000000
0000000
0000000
0111111
0000010
0010010
?
0000000
0000000
0000000
0000001
1010110
0000001
0010000
?
0000000
0000000
0000011
0000010
0000010
0000001
0100100
?
0000000
...

result:

points 1.0 points  1.0 correct, 8 queries

Test #128:

score: 78
Accepted
time: 504ms
memory: 3820kb

input:

10
46
55
52
58
44
58
60
58
65
60
68
88
72
84
90

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111110
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000010
1101001111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 15 queries

Test #129:

score: 78
Accepted
time: 523ms
memory: 3612kb

input:

10
10
20
30
20
37
46
44
46
44
82
51
55
72
76
75

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0111101111
1000000000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 15 queries

Test #130:

score: 78
Accepted
time: 277ms
memory: 3640kb

input:

10
91
55
68
64
72
88
65
88
85
85

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000111111
0011001100
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 10 queries

Test #131:

score: 78
Accepted
time: 670ms
memory: 3664kb

input:

10
55
46
44
52
65
79
73
73
65
70
70
65
72
75
88
82
92
82

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
0110110011
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 18 queries

Test #132:

score: 78
Accepted
time: 726ms
memory: 3612kb

input:

10
73
44
52
52
60
64
65
64
76
80
85
70
82
72
79
75
84
79

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000111
1010010000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 18 queries

Test #133:

score: 78
Accepted
time: 743ms
memory: 3872kb

input:

10
19
36
36
28
44
37
36
58
58
46
60
52
70
70
76
65
72
82
86
70

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111110111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000111
1111001000
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 20 queries

Test #134:

score: 78
Accepted
time: 337ms
memory: 3896kb

input:

10
64
55
60
55
76
68
76
85
88
85
65

output:

?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
1111111111
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000001
0110111001
?
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
00000000...

result:

points 1.0 points  1.0 correct, 11 queries

Test #135:

score: 0
Time Limit Exceeded

input:

100
100
200
200
300
300
500
600
700
800
800
700
900
900
1100
900
500
700
900
1300
1000
900
1500
1000
1300
1400
1300
1500
1400
1300
2000
1300
1400
1500
1900
1300
2100
1600
2000
2600
1600
2600
1800
2300
2700
3000
3300
2500
2600
2700
2800
2700
2400
2400
2900
2000
2700
2800
3200
2700
2900
2700
3700
3900...

output:

?
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result: