QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#480025 | #8644. Tricolor Lights | Qwerty1232# | 0 | 25ms | 4360kb | C++23 | 2.6kb | 2024-07-16 01:15:16 | 2024-07-16 01:15:17 |
Judging History
Anna
#include "Anna.h"
#include <bits/stdc++.h>
namespace A {
std::vector<int> gen_string(int n) {
std::vector<int> s(n);
std::mt19937 rnd(2086 + 5);
for (int i = 0; i < n; i++) {
s[i] = rnd() % 3;
}
return s;
}
int fuck(char ch) {
std::string s = "RGB";
return std::find(s.begin(), s.end(), ch) - s.begin();
}
} // namespace A
std::pair<std::string, int> anna(int n, std::string S) {
auto data = A::gen_string(n + 1 >> 1);
if (S.size() % 2) {
S.push_back('R');
}
std::mt19937 rnd(222);
std::string t(S.size(), '-');
for (int i = 0; i < S.size(); i += 2) {
std::string a = "RGB", b = "RGB";
std::erase(a, S[i]);
std::erase(b, S[i + 1]);
std::shuffle(a.begin(), a.end(), rnd);
std::shuffle(b.begin(), b.end(), rnd);
for (int ch1 : a) {
for (int ch2 : b) {
if ((A::fuck(ch1) + A::fuck(ch2)) % 3 == data[i / 2]) {
t[i] = ch1;
t[i + 1] = ch2;
break;
}
}
}
}
if (n % 2) {
t.pop_back();
}
return {t, std::min(n, 100)};
}
Bruno
#include "Bruno.h"
#include <bits/stdc++.h>
namespace B {
std::vector<int> gen_string(int n) {
std::vector<int> s(n);
std::mt19937 rnd(2086 + 5);
for (int i = 0; i < n; i++) {
s[i] = rnd() % 3;
}
return s;
}
int fuck(char ch) {
std::string s = "RGB";
return std::find(s.begin(), s.end(), ch) - s.begin();
}
} // namespace B
int n, l;
std::vector<int> str;
std::map<int, std::map<std::vector<int>, int>> map;
void init(int N, int L) {
n = N, l = L;
str = B::gen_string(N + 1 >> 1);
}
int find_str(std::string s) {
if (s.size() % 2) {
s.pop_back();
}
std::vector<int> vec;
for (int i = 0; i < s.size(); i += 2) {
vec.push_back((B::fuck(s[i]) + B::fuck(s[i + 1])) % 3);
}
auto& mp = map[vec.size()];
if (mp.empty()) {
for (int i = 0; i + vec.size() <= str.size(); i++) {
mp[std::vector<int>(str.begin() + i, str.begin() + i + vec.size())] = i;
}
}
int res = mp.contains(vec) ? mp[vec] : -1;
return res;
}
int bruno(std::string u) {
int a = find_str(u);
if (a != -1) {
return a * 2 + 1;
} else {
int b = find_str(u.substr(1));
assert(b != -1);
return b * 2;
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 5
Accepted
time: 25ms
memory: 4284kb
Manager to Aoi
Start Success 8 RGGBRBBG
Aoi to Manager
Start 0 0 GBBGBGRB 8
Manager to Bitaro
Start Success 10000 8 8 GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBG...
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: 0
Wrong Answer
time: 1ms
memory: 4264kb
Manager to Aoi
Start Success 1 G
Aoi to Manager
Start 0 0 B 1
Manager to Bitaro
Start Success 10000 1 1 B WA
Bitaro to Manager
Start 0 0 3
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: 24ms
memory: 4284kb
Manager to Aoi
Start Success 8 RGGBRBBG
Aoi to Manager
Start 0 0 GBBGBGRB 8
Manager to Bitaro
Start Success 10000 8 8 GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBGBGRB Success GBBG...
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: 0
Wrong Answer
time: 1ms
memory: 4360kb
Manager to Aoi
Start Success 1 G
Aoi to Manager
Start 0 0 B 1
Manager to Bitaro
Start Success 10000 1 1 B WA
Bitaro to Manager
Start 0 0 3
Manager to Checker
0.00
result:
points 0.0