QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#720998#8644. Tricolor Lightshhoppitree0 28ms4556kbC++172.1kb2024-11-07 14:55:442024-11-07 14:55:44

Judging History

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

  • [2024-11-07 14:55:44]
  • 评测
  • 测评结果:0
  • 用时:28ms
  • 内存:4556kb
  • [2024-11-07 14:55:44]
  • 提交

Anna

#include <bits/stdc++.h>
#include "Anna.h"

using namespace std;

namespace Anna {
    int v[1 << 20];

    pair<string, int> anna(int n, string S) {
        if (n <= 28) {
            string T;
            for (int i = 0; i < n; ++i) {
                T += (S[i] == 'R' ? 'G' : 'R');
            }
            return {T, n};
        }
        mt19937 rnd;
        for (int i = 0; i < n; ++i) v[i] = rnd() % 3;
        string T;
        for (int i = 0; i < n; i += 2) {
            int ok = 0;
            for (int j = 0; j < 3 && !ok; ++j) {
                for (int k = 0; k < 3; ++k) {
                    if ((j + k) % 3 != v[i] || "RGB"[j] == S[i] || "RGB"[k] == S[i + 1]) {
                        continue;
                    }
                    T += "RGB"[j];
                    T += "RGB"[k];
                    ok = 1;
                    break;
                }
            }
        }
        if (n & 1) {
            T += (S.back() == 'R' ? 'G' : 'R');
        }
        return {T, 28};
    }
}

pair<string, int> anna(int n, string S) {
    return Anna::anna(n, S);
}

Bruno

#include <bits/stdc++.h>
#include "Bruno.h"

using namespace std;

namespace Bruno {
    int n, m, v[1 << 20];

    map<string, int> M;

    void init(int _n, int _m) {
        n = _n, m = _m;
        mt19937 rnd;
        for (int i = 0; i < n; ++i) v[i] = rnd() % 3;
        for (int i = 0; i < n; i += 2) {
            string o;
            for (int j = 0; j < 14; ++j) {
                o += "012"[v[i + j * 2]];
                if (j == 12 || j == 13) M[o] = i + 1;
            }
        }
    }

    int tr(char c) {
        return (c == 'R' ? 0 : (c == 'G' ? 1 : 2));
    }

    int bruno(string s) {
        if (n == m) return 1;
        for (int i = 0; i < 2; ++i) {
            string T;
            for (int j = i; j + 1 < m; j += 2) {
                T += "012"[(tr(s[j]) + tr(s[j + 1])) % 3];
            }
            if (M.count(T)) return M[T] - i;
        }
        return -1;
    }
}

void init(int n, int l) {
    Bruno::init(n, l);
}

int bruno(string s) {
    return Bruno::bruno(s);
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 5
Accepted
time: 28ms
memory: 4268kb

Manager to Aoi

Start
Success
8
RGGBRBBG

Aoi to Manager

Start
0
0
GRRRGRRR
8

Manager to Bitaro

Start
Success
10000
8
8
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRR...

Bitaro to Manager

Start
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #2:

score: 5
Accepted
time: 7ms
memory: 4356kb

Manager to Aoi

Start
Success
1
G

Aoi to Manager

Start
0
0
R
1

Manager to Bitaro

Start
Success
10000
1
1
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Succ...

Bitaro to Manager

Start
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #3:

score: 5
Accepted
time: 21ms
memory: 4292kb

Manager to Aoi

Start
Success
2
BB

Aoi to Manager

Start
0
0
RR
2

Manager to Bitaro

Start
Success
10000
2
2
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
R...

Bitaro to Manager

Start
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #4:

score: 5
Accepted
time: 19ms
memory: 4316kb

Manager to Aoi

Start
Success
28
RRRRRRRRRRRRRRRRRRRRRRRRRRRR

Aoi to Manager

Start
0
0
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
28

Manager to Bitaro

Start
Success
10000
28
28
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGG...

Bitaro to Manager

Start
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #5:

score: 5
Accepted
time: 23ms
memory: 4552kb

Manager to Aoi

Start
Success
60
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

Aoi to Manager

Start
0
0
GGGGRGGGRRRGRRGGRRRGGGGGRRRGRGRRRGRRRGRGRRGGGGRRRGRGGGRRRGRG
28

Manager to Bitaro

Start
Success
10000
60
28
RRGGRRRGGGGGRRRGRGRRRGRRRGRG
Success
GRRRGRGRRRGRRRGRGRRGGGGRRRGR
Success
RGRRRGRRRGRGRRGGGGRRRGRGGGRR
Success
RGGRRRGGGGGRRRGRGRRRGRRRGRGR
Success
RGGRRRGGGGGRRRGRGRRRGRRRGRGR
Success
GGGRGGGRRRGRRGGRRRGGGGGRRRGR
Success
GGRRRGGGGGRRRGRGRRRGRRRGRGRR
Success
RRRGGGGGRRRGRGR...

Bitaro to Manager

Start
0
0
13
0
24
0
29
0
14
0
14
0
2
0
15
0
17
0
31
0
33
0
33
0
24
0
2
0
13
0
11
0
15
0
33
0
16
0
20
0
17
0
32
0
5
0
9
0
2
0
25
0
30
0
9
0
11
0
32
0
21
0
33
0
4
0
30
0
16
0
10
0
6
0
12
0
9
0
16
0
5
0
3
0
26
0
21
0
11
0
16
0
5
0
24
0
16
0
2
0
23
0
1
0
14
0
14
0
30
0
21
0
7
0
1
0
21
0
20
0
28
0
30
0
3...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #6:

score: 5
Accepted
time: 27ms
memory: 4276kb

Manager to Aoi

Start
Success
130
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

Aoi to Manager

Start
0
0
GGGGBBGGGBBBGBGGGBBBGGGGGBBBBBGBBBGBBBBBGBGGGGGBBBBBGGGBBBBBBBBBGBBBGBGGGBGBGGBBGGBBGGBBGBGGBBGBBBBBGGBBGBGGGGBBGGBBGBBBGBGGGBBBGG
28

Manager to Bitaro

Start
Success
10000
130
28
BBGBGGBBGBBBBBGGBBGBGGGGBBGG
Success
BGBGGGBBBGGGGGBBBBBGBBBGBBBB
Success
GBBGBBBBBGGBBGBGGGGBBGGBBGBB
Success
GBGGBBGBBBBBGGBBGBGGGGBBGGBB
Success
GGBBGBGGGGBBGGBBGBBBGBGGGBBB
Success
GBBBGBBBBBGBGGGGGBBBBBGGGBBB
Success
BBBBGBBBGBGGGBGBGGBBGGBBGGBB
Success
GGBBGGBBGGBBGB...

Bitaro to Manager

Start
0
0
87
0
12
0
92
0
89
0
101
0
31
0
61
0
77
0
10
0
70
0
90
0
24
0
65
0
59
0
22
0
63
0
98
0
103
0
26
0
24
0
43
0
22
0
9
0
103
0
72
0
81
0
66
0
7
0
79
0
73
0
23
0
33
0
62
0
45
0
56
0
34
0
97
0
90
0
35
0
24
0
75
0
99
0
44
0
84
0
46
0
1
0
35
0
10
0
33
0
18
0
91
0
55
0
63
0
4
0
13
0
42
0
28
0
95
0
2...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #7:

score: 0
Wrong Answer
time: 1ms
memory: 4556kb

Manager to Aoi

Start
Success
131
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
WA

Aoi to Manager

Start
0
1

Manager to Bitaro

Start
WA

Bitaro to Manager

Start

Manager to Checker

0.00

result:

points 0.0

Subtask #2:

score: 0
Skipped

Subtask #3:

score: 0
Skipped

Subtask #4:

score: 0
Skipped

Subtask #5:

score: 0
Wrong Answer

Test #80:

score: 70
Accepted
time: 27ms
memory: 4264kb

Manager to Aoi

Start
Success
8
RGGBRBBG

Aoi to Manager

Start
0
0
GRRRGRRR
8

Manager to Bitaro

Start
Success
10000
8
8
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRRGRRR
Success
GRRR...

Bitaro to Manager

Start
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #81:

score: 70
Accepted
time: 21ms
memory: 4512kb

Manager to Aoi

Start
Success
1
G

Aoi to Manager

Start
0
0
R
1

Manager to Bitaro

Start
Success
10000
1
1
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Success
R
Succ...

Bitaro to Manager

Start
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #82:

score: 70
Accepted
time: 9ms
memory: 4292kb

Manager to Aoi

Start
Success
2
BB

Aoi to Manager

Start
0
0
RR
2

Manager to Bitaro

Start
Success
10000
2
2
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
RR
Success
R...

Bitaro to Manager

Start
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #83:

score: 70
Accepted
time: 20ms
memory: 4524kb

Manager to Aoi

Start
Success
28
RRRRRRRRRRRRRRRRRRRRRRRRRRRR

Aoi to Manager

Start
0
0
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
28

Manager to Bitaro

Start
Success
10000
28
28
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGGGGGGGGGGGGGGG
Success
GGGGGGGGGGGGGGG...

Bitaro to Manager

Start
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #84:

score: 70
Accepted
time: 11ms
memory: 4300kb

Manager to Aoi

Start
Success
60
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

Aoi to Manager

Start
0
0
GGGGRGGGRRRGRRGGRRRGGGGGRRRGRGRRRGRRRGRGRRGGGGRRRGRGGGRRRGRG
28

Manager to Bitaro

Start
Success
10000
60
28
GGGGGRRRGRGRRRGRRRGRGRRGGGGR
Success
GRRRGRGRRRGRRRGRGRRGGGGRRRGR
Success
RRGGGGGRRRGRGRRRGRRRGRGRRGGG
Success
RGRRGGRRRGGGGGRRRGRGRRRGRRRG
Success
GGRRRGRRGGRRRGGGGGRRRGRGRRRG
Success
RGRRRGRRRGRGRRGGGGRRRGRGGGRR
Success
RGRRRGRGRRGGGGRRRGRGGGRRRGRG
Success
RRGGRRRGGGGGRRR...

Bitaro to Manager

Start
0
0
20
0
24
0
18
0
11
0
7
0
29
0
33
0
13
0
3
0
23
0
7
0
15
0
4
0
23
0
4
0
24
0
33
0
25
0
31
0
28
0
4
0
32
0
6
0
5
0
20
0
24
0
31
0
24
0
33
0
9
0
18
0
22
0
13
0
14
0
19
0
1
0
21
0
20
0
25
0
6
0
21
0
32
0
29
0
12
0
20
0
12
0
11
0
15
0
1
0
1
0
13
0
11
0
33
0
25
0
18
0
7
0
26
0
19
0
4
0
16
0
1
0
5...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #85:

score: 70
Accepted
time: 14ms
memory: 4272kb

Manager to Aoi

Start
Success
130
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR

Aoi to Manager

Start
0
0
GGGGBBGGGBBBGBGGGBBBGGGGGBBBBBGBBBGBBBBBGBGGGGGBBBBBGGGBBBBBBBBBGBBBGBGGGBGBGGBBGGBBGGBBGBGGBBGBBBBBGGBBGBGGGGBBGGBBGBBBGBGGGBBBGG
28

Manager to Bitaro

Start
Success
10000
130
28
BBBBBBBBGBBBGBGGGBGBGGBBGGBB
Success
BBBBBGBGGGGGBBBBBGGGBBBBBBBB
Success
GGGBBBGBGGGBBBGGGGGBBBBBGBBB
Success
GGBBGGBBGGBBGBGGBBGBBBBBGGBB
Success
BBBBGGBBGBGGGGBBGGBBGBBBGBGG
Success
GBBGBBBBBGGBBGBGGGGBBGGBBGBB
Success
GBBBGBGGGBBBGGGGGBBBBBGBBBGB
Success
GGGGGBBBBBGGGB...

Bitaro to Manager

Start
0
0
57
0
36
0
7
0
77
0
97
0
92
0
9
0
43
0
90
0
36
0
29
0
1
0
65
0
81
0
67
0
31
0
86
0
60
0
43
0
20
0
68
0
62
0
42
0
91
0
37
0
1
0
103
0
32
0
35
0
38
0
68
0
44
0
40
0
16
0
99
0
10
0
84
0
49
0
75
0
8
0
91
0
61
0
49
0
60
0
93
0
72
0
38
0
51
0
42
0
11
0
49
0
30
0
67
0
101
0
33
0
23
0
75
0
68
0
63
...

Manager to Checker

1.000000000000000

result:

points 1.0

Test #86:

score: 0
Wrong Answer
time: 0ms
memory: 4236kb

Manager to Aoi

Start
Success
131
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
WA

Aoi to Manager

Start
0
1

Manager to Bitaro

Start
WA

Bitaro to Manager

Start

Manager to Checker

0.00

result:

points 0.0