QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#300775#4896. Alice、Bob 与 DFSzyc07041935 26ms18324kbC++146.0kb2024-01-08 19:47:592024-01-08 19:47:59

Judging History

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

  • [2024-01-08 19:47:59]
  • 评测
  • 测评结果:35
  • 用时:26ms
  • 内存:18324kb
  • [2024-01-08 19:47:59]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 3;

inline int read() {
    char ch = getchar(); int x = 0;
    while (!isdigit(ch)) {ch = getchar();}
    while (isdigit(ch)) {x = x * 10 + ch - 48; ch = getchar();}
    return x;
}

int n, c[N];
vector<int> g[N], vec;

namespace subtask1 {
    bool dp[N], ans;
    
    bool check() {
        for (int i = 1; i <= n; ++i)
            if (c[i] == 1) return false;
        return true;
    }

    void solve() {
        for (int x = n; x >= 1; --x) {
            dp[x] = 1;
            for (auto y : g[x]) dp[x] ^= dp[y];
        }
        for (auto r : vec) ans ^= dp[r];
        puts(ans ? "Alice" : "Bob");
    }
}

namespace subtask2 {
    int dp[N];

    bool check() {return vec.size() == 1;}

    void solve() {
        for (int x = n; x >= 1; --x) {
            if (g[x].empty()) dp[x] = 1;
            else {
                int val = 1;
                for (auto y : g[x]) {
                    if (val == 0) {
                        if (dp[y] == 0) val = 0;
                        else if (dp[y] == 1) val = 1;
                        else {
                            val = dp[y];
                            break;
                        }
                    }else {
                        if (dp[y] == 0) val = 1;
                        else if (dp[y] == 1) val = 0;
                        else {
                            val = dp[y] ^ 1;
                            break;
                        }
                    }
                }
                if (c[x] == 0) dp[x] = val;
                else {
                    if (val == 3) dp[x] = 1;
                    else if (val == 0) dp[x] = 2;
                    else dp[x] = val;
                }
            }
        }
        puts((dp[vec[0]] == 1 || dp[vec[0]] == 2) ? "Alice" : "Bob");
    }
}

namespace subtask3 {
    int cnt, val[N], sg[2000];
    vector< pair<int, int> > now;
    vector<int> to[2000], tmp;
    vector< vector< pair<int, int> > > tot;
    
    bool check() {
        int m = 0;
        for (int x = 1; x <= n; ++x) m += g[x].size();
        return (n <= 10 && m <= 10);
    }

    void dfs(int x, int lst) {
        now.push_back(make_pair(x, lst));
        tot.push_back(now);
        for (int i = 0; i < g[x].size(); ++i) dfs(g[x][i], i);
        now.pop_back();
    }

    void solve() {
        for (int x = 1; x <= n; ++x) {
            tot.clear(); dfs(x, 0); tot.push_back(now);
            for (int i = 0; i < tot.size(); ++i) to[i].clear();
            for (int i = 0; i < tot.size(); ++i) {
                if (tot[i].empty()) continue;
                for (int j = i + 1; j < tot.size(); ++j) {
                    if (tot[j].size() <= tot[i].size()) {
                        if (tot[j].empty()) {
                            to[i].push_back(j);
                            continue;
                        }
                        bool pd = true;
                        for (int ID = 0; ID + 1 < tot[j].size(); ++ID)
                            if (tot[j][ID] != tot[i][ID]) pd = false;
                        if (!pd) continue;
                        to[i].push_back(j);
                        if (c[tot[j][tot[j].size() - 2].first] == 0) break;
                    }
                    if (tot[j].size() == tot[i].size() + 1 && tot[j][tot[i].size() - 1] == tot[i].back()) {
                        to[i].push_back(j);
                        if (c[tot[i].back().first] == 0) break;
                    }
                }
            }
            for (int i = tot.size() - 1; i >= 0; --i) {
                tmp.clear();
                for (auto j : to[i]) tmp.push_back(sg[j]);
                sort(tmp.begin(), tmp.end());
                tmp.erase(unique(tmp.begin(), tmp.end()), tmp.end());
                int ans = 0;
                while (ans < tmp.size() && ans == tmp[ans]) ans++;
                sg[i] = ans;
            }
            val[x] = sg[0];
        }
        int fin = 0;
        for (auto x : vec) fin ^= val[x];
        puts(fin ? "Alice" : "Bob");
    }
}

namespace subtask4 {
    int du[N], ans, sg[N];
    multiset<int> S, T;
    
    bool check() {
        for (int x = 1; x <= n; ++x)
            for (auto y : g[x]) du[y]++;
        for (int i = 1; i <= n; ++i)
            if (du[i] > 1) return false;
        for (auto x : vec) if (du[x]) return false;
        return true;
    }

    void ins(int x) {
        if (T.find(x) != T.end()) T.erase(T.find(x));
        else S.insert(x);
        while (S.find(ans) != S.end()) ans++;
    }

    void del(int x) {
        if (S.find(x) != S.end()) S.erase(S.find(x));
        else T.insert(x);
    }

    int work() {
        int res;
        if (T.empty()) res = ans;
        else res = min(ans, *T.begin());
        ins(res); return res;
    }

    void dfs(int x) {
        if (g[x].empty()) {
            sg[x] = work();
            return;
        }
        for (auto y : g[x]) dfs(y);
        sg[x] = work();
        for (auto y : g[x]) del(sg[y]);
    }
    
    void solve() {
        ins(0);
        for (int i = 1; i <= n; ++i) reverse(g[i].begin(), g[i].end());
        for (int i = 1; i <= n; ++i)
            if (du[i] == 0) dfs(i);
        int fin = 0;
        for (auto x : vec) fin ^= sg[x];
        puts(fin ? "Alice" : "Bob");
    }
}

int main() {
    n = read();
    for (int i = 1; i <= n; ++i) c[i] = read();
    for (int x = 1, m, y; x <= n; ++x) {
        m = read();
        while (m--) {
            y = read();
            g[x].push_back(y);
        }
    }
    int k = read(), x;
    while (k--) x = read(), vec.push_back(x);

    // subtask4 :: solve(); exit(0);

    if (subtask1 :: check()) subtask1 :: solve();
    else if (subtask2 :: check()) subtask2 :: solve();
    else if (subtask3 :: check()) subtask3 :: solve();
    else if (subtask4 :: check()) subtask4 :: solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 2ms
memory: 10052kb

input:

1000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Alice

result:

ok "Alice"

Test #2:

score: 0
Accepted
time: 2ms
memory: 11828kb

input:

1000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Bob

result:

ok "Bob"

Test #3:

score: 0
Accepted
time: 0ms
memory: 10044kb

input:

1000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Alice

result:

ok "Alice"

Test #4:

score: 0
Accepted
time: 1ms
memory: 10500kb

input:

10
0 0 0 0 0 0 0 0 0 0
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
0
1
1

output:

Bob

result:

ok "Bob"

Test #5:

score: 0
Accepted
time: 1ms
memory: 10240kb

input:

11
0 0 0 0 0 0 0 0 0 0 0
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
0
0
2
1 11

output:

Alice

result:

ok "Alice"

Test #6:

score: 0
Accepted
time: 8ms
memory: 17612kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Bob

result:

ok "Bob"

Test #7:

score: 0
Accepted
time: 12ms
memory: 18324kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Bob

result:

ok "Bob"

Test #8:

score: 0
Accepted
time: 26ms
memory: 15892kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Alice

result:

ok "Alice"

Test #9:

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

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Bob

result:

ok "Bob"

Test #10:

score: 0
Accepted
time: 18ms
memory: 16200kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Bob

result:

ok "Bob"

Test #11:

score: 0
Accepted
time: 14ms
memory: 14948kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Bob

result:

ok "Bob"

Test #12:

score: 0
Accepted
time: 18ms
memory: 15412kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Bob

result:

ok "Bob"

Test #13:

score: 0
Accepted
time: 14ms
memory: 15396kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Alice

result:

ok "Alice"

Test #14:

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

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Bob

result:

ok "Bob"

Test #15:

score: 0
Accepted
time: 1ms
memory: 10740kb

input:

1
0
0
1
1

output:

Alice

result:

ok "Alice"

Test #16:

score: 0
Accepted
time: 2ms
memory: 10204kb

input:

3
0 0 0
1 2
1 3
0
1
1

output:

Alice

result:

ok "Alice"

Test #17:

score: 0
Accepted
time: 1ms
memory: 9972kb

input:

4
0 0 0 0
1 2
1 3
0
0
2
1 4

output:

Bob

result:

ok "Bob"

Subtask #2:

score: 15
Accepted

Test #18:

score: 15
Accepted
time: 0ms
memory: 10344kb

input:

7
0 0 1 1 0 1 1
1 2
2 3 4
0
2 5 6
0
1 7
0
1
1

output:

Bob

result:

ok "Bob"

Test #19:

score: 0
Accepted
time: 0ms
memory: 10456kb

input:

6
0 1 0 0 1 0
2 2 6
3 3 4 5
0
0
0
0
1
1

output:

Bob

result:

ok "Bob"

Test #20:

score: 0
Accepted
time: 1ms
memory: 11800kb

input:

3
0 1 0
1 2
1 3
0
1
1

output:

Bob

result:

ok "Bob"

Test #21:

score: 0
Accepted
time: 0ms
memory: 10692kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
4 3 5 7 8
1 4
0
1 6
0
0
1 9
1 10
0
1
1

output:

Alice

result:

ok "Alice"

Test #22:

score: 0
Accepted
time: 1ms
memory: 10120kb

input:

10
1 0 0 1 1 1 0 0 1 0
2 2 3
0
1 4
1 5
1 6
3 7 9 10
1 8
0
0
0
1
1

output:

Alice

result:

ok "Alice"

Test #23:

score: 0
Accepted
time: 1ms
memory: 10352kb

input:

10
1 1 1 1 1 1 1 1 1 1
4 2 3 4 10
0
0
1 5
1 6
2 7 8
0
1 9
0
0
1
1

output:

Alice

result:

ok "Alice"

Test #24:

score: 0
Accepted
time: 2ms
memory: 10008kb

input:

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

output:

Bob

result:

ok "Bob"

Test #25:

score: 0
Accepted
time: 1ms
memory: 10432kb

input:

98
0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 1 1 1 0 0 1 0 1 1 0 0 1 0 0 1 0 1 1 1 1 0 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 1 0 0 0 1 1 0 1 0 1 0 0 0 0 1 1 1 1 1 0 1 1 1 1 1 1 0 1 0 0 1 0 0 0 1 1 0
1 2
1 3
1 4
4 5 6 11 12
0
1 7
2 8 9
0
1 10
0
0
1 13
1 14
2 15 54
11 16 17 18 41 42 45 46 47 50 52 53
...

output:

Bob

result:

ok "Bob"

Test #26:

score: 0
Accepted
time: 2ms
memory: 11792kb

input:

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

output:

Bob

result:

ok "Bob"

Test #27:

score: 0
Accepted
time: 0ms
memory: 10532kb

input:

8
0 0 0 1 1 0 1 1
1 2
1 3
1 4
3 5 6 7
0
0
1 8
0
1
1

output:

Bob

result:

ok "Bob"

Test #28:

score: 0
Accepted
time: 1ms
memory: 10616kb

input:

100
0 0 0 1 1 0 1 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 0 0 0 0 1 1 0 1 0 1 1 0 0 1 0 0 1 0 0 1 1 1 0 0 1 1 1 0 1 1 0 0 1 1 1 0 1 0 1 0 0 1 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 1 1 1 1
9 2 3 80 88 89 95 96 97 99
0
1 4
3 5 78 79
3 6 7 8
0
0
5 9 10 11 75 76
0
0
2 12 71
1 13
1 14
3 1...

output:

Bob

result:

ok "Bob"

Test #29:

score: 0
Accepted
time: 1ms
memory: 11832kb

input:

100
0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 0 1 0 1 1 1 1 1 1 1 0 0 1 1
17 2 3 4 9 10 12 13 14 15 16 19 64 66 70 71 99 100
0
0
1 5
2 6 7
0
1 8
0
0
1 11
0
0
0
0
0
1 17
1...

output:

Alice

result:

ok "Alice"

Test #30:

score: 0
Accepted
time: 0ms
memory: 10952kb

input:

1000
1 0 0 1 1 0 1 0 1 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 1 1 0 1 0 0 0 0 1 0 1 1 1 0 0 1 0 0 0 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 0 1 1 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 1 0 1 1 1 1 0 0...

output:

Alice

result:

ok "Alice"

Test #31:

score: 0
Accepted
time: 0ms
memory: 12032kb

input:

777
0 1 0 0 0 1 1 0 0 1 1 0 1 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 1 0 1 0 1 1 1 1 0 0 1 0 1 1 1 1 0 1 0 0 1 0 1 0 1 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 0 1 0 1 0 0 0 1 1 1 1 0 1 0 1 0 1 1 1 1 1 1 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 ...

output:

Bob

result:

ok "Bob"

Test #32:

score: 0
Accepted
time: 1ms
memory: 11812kb

input:

960
0 1 0 1 0 1 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 1 1 0 0 0 1 0 0 1 0 1 0 1 0 1 1 1 1 1 1 0 1 1 1 0 1 0 1 0 1 0 0 0 1 1 0 0 1 1 1 0 1 0 0 1 1 1 1 0 0 1 0 0 1 1 1 0 0 1 1 1 1 1 0 1 1 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 0 0 0 1 0 0 ...

output:

Bob

result:

ok "Bob"

Test #33:

score: 0
Accepted
time: 9ms
memory: 12652kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

Alice

result:

ok "Alice"

Test #34:

score: 0
Accepted
time: 1ms
memory: 10852kb

input:

10
0 0 0 0 0 0 0 0 0 0
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
0
1
1

output:

Bob

result:

ok "Bob"

Test #35:

score: 0
Accepted
time: 1ms
memory: 9992kb

input:

10
1 1 1 1 1 1 1 1 1 1
9 2 3 4 5 6 7 8 9 10
0
0
0
0
0
0
0
0
0
1
1

output:

Alice

result:

ok "Alice"

Test #36:

score: 0
Accepted
time: 7ms
memory: 12380kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

Alice

result:

ok "Alice"

Test #37:

score: 0
Accepted
time: 2ms
memory: 11732kb

input:

10
0 1 0 0 1 1 1 1 0 0
3 2 8 9
1 3
2 4 6
1 5
0
1 7
0
0
1 10
0
1
1

output:

Bob

result:

ok "Bob"

Test #38:

score: 0
Accepted
time: 1ms
memory: 11956kb

input:

2
0 1
1 2
0
1
1

output:

Bob

result:

ok "Bob"

Test #39:

score: 0
Accepted
time: 13ms
memory: 17292kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Bob

result:

ok "Bob"

Test #40:

score: 0
Accepted
time: 11ms
memory: 12656kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

Alice

result:

ok "Alice"

Test #41:

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

input:

200000
1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1...

output:

Alice

result:

ok "Alice"

Test #42:

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

input:

199285
0 1 0 1 1 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 1 0 0 0 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 0 1 1 0 1 1 1 1 0 0 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 1 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 1 1 0 0 0 0 1 1 0 0 1 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0...

output:

Bob

result:

ok "Bob"

Test #43:

score: 0
Accepted
time: 20ms
memory: 16248kb

input:

200000
1 0 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 0 1 1 1 0 0 0 1 1 1 1 0 1 1 0 0 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 0 0 1 0 0 1 0 1 1 1 0 0 1 1 1 1 0 0 1 1 0 0 1 0 1 1 1 1 0 0 1 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 1 1 1 0 0 1 1 0 1 1 0 1 0 0 1 1 1 1 1 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 1 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0...

output:

Alice

result:

ok "Alice"

Test #44:

score: 0
Accepted
time: 18ms
memory: 15088kb

input:

200000
0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 0 1 0 1 0 0 1 0 1 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1 1 0 1 1 0 1 1 0 0 0 0 0 0 1 1 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0...

output:

Alice

result:

ok "Alice"

Test #45:

score: 0
Accepted
time: 18ms
memory: 16072kb

input:

200000
1 0 1 1 1 0 0 0 1 0 1 0 1 1 1 1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 1 0 1 0 0 0 1 0 0 1 1 1 0 1 0 1 1 1 1 0 1 1 0 0 0 0 1 1 1 1 1 0 1 0 1 0 1 1 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 1 0 0 1 0 0 0 1 1...

output:

Alice

result:

ok "Alice"

Test #46:

score: 0
Accepted
time: 18ms
memory: 15048kb

input:

200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Bob

result:

ok "Bob"

Test #47:

score: 0
Accepted
time: 1ms
memory: 11808kb

input:

3
0 1 0
2 2 3
1 3
0
1
1

output:

Bob

result:

ok "Bob"

Test #48:

score: 0
Accepted
time: 0ms
memory: 11744kb

input:

2
1 0
2 2 2
0
1
1

output:

Alice

result:

ok "Alice"

Test #49:

score: 0
Accepted
time: 1ms
memory: 10060kb

input:

3
1 1 1
1 2
1 3
0
1
1

output:

Alice

result:

ok "Alice"

Test #50:

score: 0
Accepted
time: 1ms
memory: 10096kb

input:

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

output:

Alice

result:

ok "Alice"

Test #51:

score: 0
Accepted
time: 1ms
memory: 10988kb

input:

27
1 1 1 1 0 0 0 1 1 1 0 1 1 1 1 0 0 1 0 1 1 1 0 0 1 0 0
2 2 8
2 3 6
2 4 5
0
0
2 12 7
0
2 9 11
2 10 12
0
2 12 27
2 13 20
2 14 17
2 15 16
0
0
2 18 19
0
0
2 21 24
2 22 23
0
0
2 25 26
0
0
0
1
1

output:

Alice

result:

ok "Alice"

Test #52:

score: 0
Accepted
time: 1ms
memory: 11744kb

input:

1
0
0
1
1

output:

Alice

result:

ok "Alice"

Test #53:

score: 0
Accepted
time: 0ms
memory: 11708kb

input:

1
1
0
1
1

output:

Alice

result:

ok "Alice"

Test #54:

score: 0
Accepted
time: 2ms
memory: 11728kb

input:

3
0 0 0
1 2
1 3
0
1
1

output:

Alice

result:

ok "Alice"

Subtask #3:

score: 15
Accepted

Test #55:

score: 15
Accepted
time: 1ms
memory: 10352kb

input:

7
0 0 1 1 0 1 1
1 2
2 3 4
0
2 5 6
0
1 7
0
1
1

output:

Bob

result:

ok "Bob"

Test #56:

score: 0
Accepted
time: 0ms
memory: 10012kb

input:

6
0 1 0 0 1 0
2 2 6
3 3 4 5
0
0
0
0
1
1

output:

Bob

result:

ok "Bob"

Test #57:

score: 0
Accepted
time: 0ms
memory: 10052kb

input:

3
0 1 0
1 2
1 3
0
1
1

output:

Bob

result:

ok "Bob"

Test #58:

score: 0
Accepted
time: 1ms
memory: 10112kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
4 3 5 7 8
1 4
0
1 6
0
0
1 9
1 10
0
1
1

output:

Alice

result:

ok "Alice"

Test #59:

score: 0
Accepted
time: 0ms
memory: 11812kb

input:

10
1 0 0 1 1 1 0 0 1 0
2 2 3
0
1 4
1 5
1 6
3 7 9 10
1 8
0
0
0
1
1

output:

Alice

result:

ok "Alice"

Test #60:

score: 0
Accepted
time: 1ms
memory: 10832kb

input:

10
1 1 1 1 1 1 1 1 1 1
4 2 3 4 10
0
0
1 5
1 6
2 7 8
0
1 9
0
0
1
1

output:

Alice

result:

ok "Alice"

Test #61:

score: 0
Accepted
time: 1ms
memory: 9888kb

input:

10
1 1 1 1 1 1 1 1 1 1
2 2 7
1 3
2 4 6
1 5
0
0
0
1 9
0
0
10
8 10 10 8 10 8 10 10 1 8

output:

Alice

result:

ok "Alice"

Test #62:

score: 0
Accepted
time: 1ms
memory: 10712kb

input:

10
1 1 1 1 1 1 1 1 1 1
2 2 3
0
0
1 5
0
2 7 9
1 8
0
0
0
10
6 6 4 1 1 4 10 10 10 6

output:

Alice

result:

ok "Alice"

Test #63:

score: 0
Accepted
time: 1ms
memory: 10644kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
0
2 4 5
0
1 6
0
0
0
0
0
10
10 10 1 9 8 9 10 7 7 3

output:

Alice

result:

ok "Alice"

Test #64:

score: 0
Accepted
time: 1ms
memory: 9976kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
1 3
1 4
1 5
2 6 7
0
2 8 9
0
1 10
0
10
1 1 1 1 1 1 1 1 1 1

output:

Bob

result:

ok "Bob"

Test #65:

score: 0
Accepted
time: 1ms
memory: 10776kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
0
1 4
0
1 6
0
0
0
0
0
10
10 9 1 10 8 1 3 7 9 5

output:

Bob

result:

ok "Bob"

Test #66:

score: 0
Accepted
time: 1ms
memory: 10372kb

input:

10
1 1 1 1 1 1 1 1 1 1
2 2 3
0
2 4 6
1 5
0
1 7
0
0
0
0
10
10 9 1 8 1 10 10 9 1 1

output:

Bob

result:

ok "Bob"

Test #67:

score: 0
Accepted
time: 1ms
memory: 10672kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 4
1 4
1 4
6 6 5 6 6 7 9
0
1 7
0
0
0
0
10
1 2 10 3 6 6 3 10 9 8

output:

Bob

result:

ok "Bob"

Test #68:

score: 0
Accepted
time: 1ms
memory: 10288kb

input:

10
1 1 1 1 1 1 1 1 1 1
2 2 2
1 3
1 4
6 5 5 5 5 5 5
0
0
0
0
0
0
10
10 9 2 8 7 8 1 6 9 2

output:

Bob

result:

ok "Bob"

Test #69:

score: 0
Accepted
time: 1ms
memory: 10152kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
1 3
4 9 6 4 5
0
2 9 6
1 8
0
1 10
0
0
10
1 3 5 10 6 9 8 5 7 10

output:

Alice

result:

ok "Alice"

Test #70:

score: 0
Accepted
time: 0ms
memory: 12020kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
2 3 10
3 10 4 5
0
2 10 6
1 7
1 10
0
0
0
10
1 2 10 1 2 9 9 2 8 2

output:

Bob

result:

ok "Bob"

Test #71:

score: 0
Accepted
time: 0ms
memory: 12012kb

input:

10
1 1 1 1 1 1 1 1 1 1
2 2 6
3 3 4 4
3 5 5 4
1 6
1 6
0
0
0
0
0
10
10 9 2 9 8 1 5 7 10 7

output:

Alice

result:

ok "Alice"

Test #72:

score: 0
Accepted
time: 1ms
memory: 10864kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
2 4 4
4 4 10 4 4
3 10 10 10
0
0
0
0
0
0
10
10 9 8 1 3 7 6 5 6 7

output:

Bob

result:

ok "Bob"

Test #73:

score: 0
Accepted
time: 1ms
memory: 11972kb

input:

8
0 0 0 1 1 0 1 1
1 2
1 3
1 4
3 5 6 7
0
0
1 8
0
1
1

output:

Bob

result:

ok "Bob"

Test #74:

score: 0
Accepted
time: 1ms
memory: 11808kb

input:

10
0 0 0 0 0 0 0 0 0 0
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
0
1
1

output:

Bob

result:

ok "Bob"

Test #75:

score: 0
Accepted
time: 1ms
memory: 11952kb

input:

10
1 1 1 1 1 1 1 1 1 1
9 2 3 4 5 6 7 8 9 10
0
0
0
0
0
0
0
0
0
1
1

output:

Alice

result:

ok "Alice"

Test #76:

score: 0
Accepted
time: 1ms
memory: 10940kb

input:

10
1 1 1 1 1 1 1 1 1 1
4 2 3 4 5
0
0
0
0
4 7 8 9 10
0
0
0
0
2
1 6

output:

Bob

result:

ok "Bob"

Test #77:

score: 0
Accepted
time: 1ms
memory: 10108kb

input:

10
1 0 0 1 1 0 1 1 1 0
2 3 2
0
2 9 4
2 5 7
1 6
1 8
0
1 10
0
0
10
1 1 4 6 8 3 10 9 4 8

output:

Alice

result:

ok "Alice"

Test #78:

score: 0
Accepted
time: 1ms
memory: 9936kb

input:

10
0 1 1 1 0 1 1 0 0 1
2 7 2
1 3
3 4 8 5
0
2 6 10
0
0
1 9
0
0
10
1 10 9 1 8 10 7 9 1 8

output:

Bob

result:

ok "Bob"

Test #79:

score: 0
Accepted
time: 1ms
memory: 9820kb

input:

10
0 1 0 0 1 1 1 1 0 0
3 2 8 9
1 3
2 4 6
1 5
0
1 7
0
0
1 10
0
1
1

output:

Bob

result:

ok "Bob"

Test #80:

score: 0
Accepted
time: 1ms
memory: 11808kb

input:

10
1 1 1 1 1 1 1 1 1 1
3 5 5 5
3 3 4 4
1 5
1 5
2 6 6
0
0
0
0
0
10
10 1 2 9 8 7 6 5 4 4

output:

Alice

result:

ok "Alice"

Test #81:

score: 0
Accepted
time: 1ms
memory: 10576kb

input:

2
0 1
1 2
0
1
1

output:

Bob

result:

ok "Bob"

Test #82:

score: 0
Accepted
time: 0ms
memory: 11952kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
1 3
0
0
0
0
0
0
0
0
10
10 9 8 7 1 6 5 4 2 5

output:

Alice

result:

ok "Alice"

Test #83:

score: 0
Accepted
time: 1ms
memory: 10044kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
1 3
1 4
1 5
3 6 7 10
0
1 8
1 9
0
0
10
1 10 10 10 1 5 4 2 8 9

output:

Alice

result:

ok "Alice"

Test #84:

score: 0
Accepted
time: 2ms
memory: 12020kb

input:

10
1 1 1 1 1 1 1 1 1 1
4 8 10 8 8
1 3
2 9 4
1 8
1 6
0
1 8
0
0
0
10
1 7 2 5 7 10 9 9 8 8

output:

Alice

result:

ok "Alice"

Test #85:

score: 0
Accepted
time: 1ms
memory: 11644kb

input:

10
1 1 0 1 0 1 1 1 1 0
4 2 2 3 2
4 4 3 4 3
1 4
0
1 6
0
0
0
0
0
10
10 9 8 5 8 9 1 5 7 7

output:

Bob

result:

ok "Bob"

Test #86:

score: 0
Accepted
time: 0ms
memory: 11796kb

input:

10
0 0 1 1 1 0 1 0 1 0
2 2 3
2 4 7
1 8
1 5
2 10 6
1 8
1 8
0
0
0
10
2 1 4 10 4 5 9 7 9 10

output:

Alice

result:

ok "Alice"

Test #87:

score: 0
Accepted
time: 1ms
memory: 11740kb

input:

10
0 0 0 0 0 1 0 0 0 0
1 2
5 3 5 6 3 3
2 6 4
2 5 5
0
0
0
0
0
0
10
10 9 4 8 7 4 6 1 1 3

output:

Bob

result:

ok "Bob"

Test #88:

score: 0
Accepted
time: 1ms
memory: 10116kb

input:

10
0 0 0 1 0 0 0 1 0 0
6 2 4 9 4 9 3
0
1 5
1 5
2 9 9
0
0
0
0
0
10
10 10 9 8 4 7 6 1 9 4

output:

Bob

result:

ok "Bob"

Test #89:

score: 0
Accepted
time: 1ms
memory: 10172kb

input:

10
0 1 0 0 0 0 1 0 0 0
6 5 4 2 5 5 4
2 4 4
1 4
1 5
0
0
0
0
0
0
10
10 9 9 8 7 6 5 3 1 3

output:

Bob

result:

ok "Bob"

Test #90:

score: 0
Accepted
time: 1ms
memory: 10360kb

input:

10
1 0 1 0 0 1 0 1 0 0
2 9 2
2 5 3
0
3 5 8 10
2 6 6
1 7
0
0
0
0
10
1 5 10 1 2 4 2 1 4 9

output:

Alice

result:

ok "Alice"

Test #91:

score: 0
Accepted
time: 1ms
memory: 12024kb

input:

10
1 1 1 1 1 0 0 1 1 1
3 2 8 5
2 3 4
1 8
0
2 9 6
1 9
1 8
0
0
0
10
10 3 10 9 2 1 7 1 5 7

output:

Alice

result:

ok "Alice"

Test #92:

score: 0
Accepted
time: 1ms
memory: 10780kb

input:

10
0 0 0 1 1 0 0 0 0 0
1 3
6 9 3 3 6 7 5
1 4
1 6
0
1 7
0
0
0
0
10
3 10 9 9 1 2 4 8 2 6

output:

Bob

result:

ok "Bob"

Test #93:

score: 0
Accepted
time: 1ms
memory: 9876kb

input:

10
1 1 1 1 0 1 1 1 1 1
2 2 3
3 3 5 9
2 6 4
2 9 5
1 6
0
0
0
0
0
10
10 9 1 1 8 10 1 9 7 2

output:

Alice

result:

ok "Alice"

Test #94:

score: 0
Accepted
time: 1ms
memory: 11744kb

input:

10
0 0 1 0 0 1 0 0 1 0
1 2
1 3
5 5 4 4 5 5
3 5 5 5
0
0
0
0
0
0
10
1 10 1 1 9 8 7 6 10 10

output:

Bob

result:

ok "Bob"

Test #95:

score: 0
Accepted
time: 1ms
memory: 10380kb

input:

3
0 1 0
2 2 3
1 3
0
1
1

output:

Bob

result:

ok "Bob"

Test #96:

score: 0
Accepted
time: 1ms
memory: 12024kb

input:

5
1 1 0 0 1
2 3 5
2 3 5
2 5 4
0
0
2
1 2

output:

Bob

result:

ok "Bob"

Test #97:

score: 0
Accepted
time: 1ms
memory: 11636kb

input:

2
1 0
2 2 2
0
1
1

output:

Alice

result:

ok "Alice"

Test #98:

score: 0
Accepted
time: 1ms
memory: 10340kb

input:

3
1 1 1
1 2
1 3
0
1
1

output:

Alice

result:

ok "Alice"

Test #99:

score: 0
Accepted
time: 1ms
memory: 11972kb

input:

1
0
0
1
1

output:

Alice

result:

ok "Alice"

Test #100:

score: 0
Accepted
time: 1ms
memory: 10200kb

input:

1
1
0
1
1

output:

Alice

result:

ok "Alice"

Test #101:

score: 0
Accepted
time: 1ms
memory: 10380kb

input:

3
0 0 0
1 2
1 3
0
1
1

output:

Alice

result:

ok "Alice"

Test #102:

score: 0
Accepted
time: 1ms
memory: 10900kb

input:

4
0 0 0 0
1 2
1 3
0
0
2
1 4

output:

Bob

result:

ok "Bob"

Subtask #4:

score: 0
Wrong Answer

Test #103:

score: 20
Accepted
time: 0ms
memory: 10992kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
4 3 5 7 8
1 4
0
1 6
0
0
1 9
1 10
0
1
1

output:

Alice

result:

ok "Alice"

Test #104:

score: 0
Accepted
time: 0ms
memory: 10476kb

input:

10
1 1 1 1 1 1 1 1 1 1
4 2 3 4 10
0
0
1 5
1 6
2 7 8
0
1 9
0
0
1
1

output:

Alice

result:

ok "Alice"

Test #105:

score: 0
Accepted
time: 0ms
memory: 11756kb

input:

10
1 1 1 1 1 1 1 1 1 1
2 2 7
1 3
2 4 6
1 5
0
0
0
1 9
0
0
10
8 10 10 8 10 8 10 10 1 8

output:

Alice

result:

ok "Alice"

Test #106:

score: 0
Accepted
time: 0ms
memory: 11692kb

input:

10
1 1 1 1 1 1 1 1 1 1
2 2 3
0
0
1 5
0
2 7 9
1 8
0
0
0
10
6 6 4 1 1 4 10 10 10 6

output:

Alice

result:

ok "Alice"

Test #107:

score: 0
Accepted
time: 1ms
memory: 10516kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
0
2 4 5
0
1 6
0
0
0
0
0
10
10 10 1 9 8 9 10 7 7 3

output:

Alice

result:

ok "Alice"

Test #108:

score: 0
Accepted
time: 0ms
memory: 12008kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
1 3
1 4
1 5
2 6 7
0
2 8 9
0
1 10
0
10
1 1 1 1 1 1 1 1 1 1

output:

Bob

result:

ok "Bob"

Test #109:

score: 0
Accepted
time: 1ms
memory: 11976kb

input:

10
1 1 1 1 1 1 1 1 1 1
1 2
0
1 4
0
1 6
0
0
0
0
0
10
10 9 1 10 8 1 3 7 9 5

output:

Bob

result:

ok "Bob"

Test #110:

score: 0
Accepted
time: 0ms
memory: 11768kb

input:

10
1 1 1 1 1 1 1 1 1 1
2 2 3
0
2 4 6
1 5
0
1 7
0
0
0
0
10
10 9 1 8 1 10 10 9 1 1

output:

Bob

result:

ok "Bob"

Test #111:

score: 0
Accepted
time: 1ms
memory: 10764kb

input:

100
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 2
1 3
2 4 38
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
4 14 35 36 37
1 15
1 16
1 17
1 18
2 19 31...

output:

Alice

result:

ok "Alice"

Test #112:

score: -20
Wrong Answer
time: 1ms
memory: 10180kb

input:

100
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 2
0
2 4 29
1 5
3 6 7 8
0
0
1 9
1 10
5 11 20 21 27 28
5 12 13 16 18 19
0
2 14 15
0
0
1 17
0
0
0...

output:

Alice

result:

wrong answer 1st words differ - expected: 'Bob', found: 'Alice'

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%