QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#736426 | #8644. Tricolor Lights | hhoppitree | 0 | 25ms | 4508kb | C++17 | 3.0kb | 2024-11-12 10:58:05 | 2024-11-12 10:58:05 |
Judging History
Anna
#include <bits/stdc++.h>
#include "Anna.h"
using namespace std;
namespace Anna {
const string o[] = {"", "2202102012001101000", "", "22021020120011000", "", "2202102011012000", "", "220210201101200"};
int tr(char c) {
return (c == 'R' ? 0 : (c == 'G' ? 1 : 2));
}
pair<string, int> anna(int n, string S) {
string T;
if (n <= 28) {
for (int i = 0; i < n; ++i) T += "RG"[S[i] == 'R'];
return {T, n};
}
for (int i = 0; i < n; ++i) {
if (i % 9 == 0 || i == n - 1) {
for (auto c : "RGB") {
if ((T.empty() || (tr(c) + tr(T.back())) % 3) && c != S[i]) {
T += c;
break;
}
}
continue;
}
char v1, v2;
for (auto c1 : "RGB") for (auto c2 : "RGB") {
if (c1 && c2 && c1 != S[i] && c2 != S[i + 1] && (tr(c1) + tr(c2)) % 3 == o[i % 9][i / 9 % o[i % 9].size()] - '0') {
v1 = c1, v2 = c2;
}
}
T += v1, T += v2, ++i;
}
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 {
const string o[] = {"", "2202102012001101000", "", "22021020120011000", "", "2202102011012000", "", "220210201101200"};
int tr(char c) {
return (c == 'R' ? 0 : (c == 'G' ? 1 : 2));
}
int n, m;
map<string, int> M;
void init(int _n, int _m) {
n = _n, m = _m;
if (n == m) return;
string S;
for (int i = 0; i < n; ++i) {
if (i % 9 == 0 || i == n - 1) {
S += 'X';
continue;
}
S += '*', S += (o[i % 9][i / 9 % o[i % 9].size()]), ++i;
}
for (int i = 1; i + m - 2 < n; ++i) {
M[S.substr(i, m - 1)] = i;
}
}
int bruno(string S) {
if (n == m) return 1;
string T;
for (int i = 0; i + 1 < m; ++i) {
T += ('0' + ((tr(S[i]) + tr(S[i + 1])) % 3));
}
vector<int> pos;
for (int i = 0; i < 9; ++i) {
int fl = 1;
for (int j = i; j + 1 < m; j += 9) {
fl &= (T[j] != '0');
}
if (fl) pos.push_back(i);
}
int wh;
for (int i = 0; i < (int)pos.size(); ++i) {
if (((pos[i] - pos[(i - 1 + pos.size()) % pos.size()] + 8) % 9 + 1) % 2) wh = pos[i];
}
for (int i = wh, j = 0; i < 36; i += 9) {
for (int k = i - 2; k >= j; k -= 2) {
if (k + 1 < m) T[k] = '*';
}
if (i + 1 < m) T[i] = 'X';
j = i + 1;
}
return M[T];
}
}
void init(int n, int l) {
Bruno::init(n, l);
}
int bruno(string s) {
return Bruno::bruno(s);
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 5
Accepted
time: 6ms
memory: 4236kb
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: 13ms
memory: 4252kb
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: 25ms
memory: 4508kb
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: 4192kb
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: 0
Wrong Answer
time: 0ms
memory: 4228kb
Manager to Aoi
Start Success 60 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB WA
Aoi to Manager
Start 0 0 RGGGGGGGGRGGGGGGGGRRRRRRRRRGGGGGGGGGRGRGRGRGRGRRRRRRRRGGGGGR 28
Manager to Bitaro
Start Success 10000 60 28 GGGGGGRRRRRRRRRGGGGGGGGGRGRG Success RRRRGGGGGGGGGRGRGRGRGRGRRRRR WA
Bitaro to Manager
Start 0 0 13 0 0
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: 9ms
memory: 4248kb
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: 11ms
memory: 4248kb
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: 17ms
memory: 4192kb
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: 15ms
memory: 4232kb
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: 0
Wrong Answer
time: 1ms
memory: 4308kb
Manager to Aoi
Start Success 60 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
Aoi to Manager
Start 0 0 RGGGGGGGGRGGGGGGGGRRRRRRRRRGGGGGGGGGRGRGRGRGRGRRRRRRRRGGGGGR 28
Manager to Bitaro
Start Success 10000 60 28 RRRRRRRRGGGGGGGGGRGRGRGRGRGR WA
Bitaro to Manager
Start 0 0 0
Manager to Checker
0.00
result:
points 0.0