QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#731138 | #9484. Colored Complete Graph | TheZone | AC ✓ | 169ms | 8804kb | C++23 | 6.3kb | 2024-11-10 00:06:33 | 2024-11-10 00:06:33 |
Judging History
answer
#include <iostream>
#include <vector>
#include <string>
#include <set>
using namespace std;
using ll = long long;
struct Dsu {
vector<int> root;
set<int> roots;
vector<pair<int, int>> edges;
int component;
Dsu(int n): root(n + 1), roots(), component(n) {
for (int i = 1; i <= n; i++) {
root[i] = i;
roots.insert(i);
}
}
int find(int x) {
return root[x] == x ? x : root[x] = find(root[x]);
}
int _merge(int x, int y) {
int x_ = find(x), y_ = find(y);
if (x_ == y_) {
return false;
}
if (x_ > y_) {
swap(x_, y_);
}
root[y_] = x_;
roots.erase(y_);
edges.emplace_back(x, y);
return true;
}
void merge(int x, int y) {
component -= _merge(x, y);
}
};
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> ess;
Dsu r(n), b(n);
char prev = -1, first = -1;
for (int i = 1; i <= n; i++) {
cout << "? " << i << " " << i % n + 1 << endl;
string z;
cin >> z;
if (z[0] == 'R') {
r.merge(i, i % n + 1);
} else {
b.merge(i, i % n + 1);
}
}
while (r.component != 1 && b.component != 1) {
int i = *next(r.roots.begin());
int j = *next(b.roots.begin());
if (b.find(1) != b.find(i)) {
j = 1;
} else if (r.find(1) != r.find(j)) {
i = 1;
}
cout << "? " << i << " " << j << endl;
string z;
cin >> z;
if (z[0] == 'R') {
r.merge(i, j);
} else {
b.merge(i, j);
}
}
if (r.component == 1) {
cout << "!" << "\n";
for (auto [u, v] : r.edges) {
cout << u << " " << v << "\n";
}
} else if (b.component == 1) {
cout << "!" << "\n";
for (auto [u, v] : b.edges) {
cout << u << " " << v << "\n";
}
}
return 0;
}
/*#include <iostream>
#include <vector>
#include <string>
#include <set>
using namespace std;
using ll = long long;
struct Dsu {
vector<int> root;
set<int> roots;
vector<pair<int, int>> edges;
int component;
Dsu(int n): root(n + 1), roots(), component(n) {
for (int i = 1; i <= n; i++) {
root[i] = i;
roots.insert(i);
}
}
int find(int x) {
return root[x] == x ? x : root[x] = find(root[x]);
}
int _merge(int x, int y) {
int x_ = find(x), y_ = find(y);
if (x_ == y_) {
return false;
}
if (x_ > y_) {
swap(x_, y_);
}
root[y_] = x_;
roots.erase(y_);
edges.emplace_back(x, y);
return true;
}
void merge(int x, int y) {
component -= _merge(x, y);
}
};
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> ess;
Dsu r(n), b(n);
char prev = -1, first = -1;
for (int i = 1; i <= n; i++) {
cout << "? " << i << " " << i % n + 1 << endl;
string z;
cin >> z;
if (z[0] == 'R') {
r.merge(i, i % n + 1);
} else {
b.merge(i, i % n + 1);
}
}
while (r.component != 1 && b.component != 1) {
int i = *next(r.roots.begin());
int j = *next(b.roots.begin());
if (b.find(1) != b.find(i)) {
j = 1;
} else if (r.find(1) != r.find(j)) {
i = 1;
}
cout << "? " << i << " " << j << endl;
string z;
cin >> z;
if (z[0] == 'R') {
r.merge(i, j);
} else {
b.merge(i, j);
}
}
if (r.component == 1) {
cout << "!" << "\n";
for (auto [u, v] : r.edges) {
cout << u << " " << v << "\n";
}
} else if (b.component == 1) {
cout << "!" << "\n";
for (auto [u, v] : b.edges) {
cout << u << " " << v << "\n";
}
}
return 0;
}#include <iostream>
#include <vector>
#include <string>
#include <set>
using namespace std;
using ll = long long;
struct Dsu {
vector<int> root;
set<int> roots;
vector<pair<int, int>> edges;
int component;
Dsu(int n): root(n + 1), roots(), component(n) {
for (int i = 1; i <= n; i++) {
root[i] = i;
roots.insert(i);
}
}
int find(int x) {
return root[x] == x ? x : root[x] = find(root[x]);
}
int _merge(int x, int y) {
int x_ = find(x), y_ = find(y);
if (x_ == y_) {
return false;
}
if (x_ > y_) {
swap(x_, y_);
}
root[y_] = x_;
roots.erase(y_);
edges.emplace_back(x, y);
return true;
}
void merge(int x, int y) {
component -= _merge(x, y);
}
};
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> ess;
Dsu r(n), b(n);
char prev = -1, first = -1;
for (int i = 1; i <= n; i++) {
cout << "? " << i << " " << i % n + 1 << endl;
string z;
cin >> z;
if (z[0] == 'R') {
r.merge(i, i % n + 1);
} else {
b.merge(i, i % n + 1);
}
}
while (r.component != 1 && b.component != 1) {
int i = *next(r.roots.begin());
int j = *next(b.roots.begin());
if (b.find(1) != b.find(i)) {
j = 1;
} else if (r.find(1) != r.find(j)) {
i = 1;
}
cout << "? " << i << " " << j << endl;
string z;
cin >> z;
if (z[0] == 'R') {
r.merge(i, j);
} else {
b.merge(i, j);
}
}
if (r.component == 1) {
cout << "!" << "\n";
for (auto [u, v] : r.edges) {
cout << u << " " << v << "\n";
}
} else if (b.component == 1) {
cout << "!" << "\n";
for (auto [u, v] : b.edges) {
cout << u << " " << v << "\n";
}
}
return 0;
}*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3628kb
input:
3 B B B
output:
? 1 2 ? 2 3 ? 3 1 ! 1 2 2 3
result:
ok AC
Test #2:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
983 B R R B B B B B R B R R R R R R R B B R R B R B R R B B R B R R R R B R B B B R R R B B R R B R B R B B B R B R R B R B B R R R B B B B R B R R B R B B R B R B R B R R R B B B R R B B B R R B R B B B R B B R R B B R R R R B R R B B B R B B B B R B R R B R R R B R R B R R B R R B R B R B B R B R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #3:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
75 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #4:
score: 0
Accepted
time: 3ms
memory: 3608kb
input:
430 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #5:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
238 B R R B B B B B R B R R R R R R R B B R R B R B R R B B R B R R R R B R B B B R R R B B R R B R B R B B B R B R R B R B B R R R B B B B R B R R B R B B R B R B R B R R R B B B R R B B B R R B R B B B R B B R R B B R R R R B R R B B B R B B B B R B R R B R R R B R R B R R B R R B R B R B B R B R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #6:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
42 R R R R R R R R R R R R R R R R R R R R R R R R R R R R B B R R R R R R R R R R R R B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #7:
score: 0
Accepted
time: 2ms
memory: 3708kb
input:
759 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #8:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
389 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #9:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
47 R R R R R R R B B R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #10:
score: 0
Accepted
time: 32ms
memory: 5360kb
input:
14657 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #11:
score: 0
Accepted
time: 8ms
memory: 5272kb
input:
15755 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #12:
score: 0
Accepted
time: 45ms
memory: 5204kb
input:
14236 B R R B B B B B R B R R R R R R R B B R R B R B R R B B R B R R R R B R B B B R R R B B R R B R B R B B B R B R R B R B B R R R B B B B R B R R B R B B R B R B R B R R R B B B R R B B B R R B R B B B R B B R R B B R R R R B R R B B B R B B B B R B R R B R R R B R R B R R B R R B R B R B B R B ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #13:
score: 0
Accepted
time: 36ms
memory: 5568kb
input:
19615 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #14:
score: 0
Accepted
time: 38ms
memory: 6984kb
input:
30668 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #15:
score: 0
Accepted
time: 79ms
memory: 7244kb
input:
39166 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #16:
score: 0
Accepted
time: 54ms
memory: 7156kb
input:
35168 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #17:
score: 0
Accepted
time: 72ms
memory: 7832kb
input:
45420 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #18:
score: 0
Accepted
time: 45ms
memory: 7900kb
input:
45526 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #19:
score: 0
Accepted
time: 52ms
memory: 8084kb
input:
48225 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #20:
score: 0
Accepted
time: 72ms
memory: 7416kb
input:
40451 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #21:
score: 0
Accepted
time: 94ms
memory: 8000kb
input:
47265 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #22:
score: 0
Accepted
time: 57ms
memory: 7324kb
input:
40881 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #23:
score: 0
Accepted
time: 117ms
memory: 8204kb
input:
44327 B R R B B B B B R B R R R R R R R B B R R B R B R R B B R B R R R R B R B B B R R R B B R R B R B R B B B R B R R B R B B R R R B B B B R B R R B R B B R B R B R B R R R B B B R R B B B R R B R B B B R B B R R B B R R R R B R R B B B R B B B B R B R R B R R R B R R B R R B R R B R B R B B R B ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #24:
score: 0
Accepted
time: 81ms
memory: 8148kb
input:
48093 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #25:
score: 0
Accepted
time: 51ms
memory: 8552kb
input:
49999 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #26:
score: 0
Accepted
time: 122ms
memory: 8324kb
input:
50000 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #27:
score: 0
Accepted
time: 130ms
memory: 8260kb
input:
50000 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #28:
score: 0
Accepted
time: 147ms
memory: 8788kb
input:
49999 B R R B B B B B R B R R R R R R R B B R R B R B R R B B R B R R R R B R B B B R R R B B R R B R B R B B B R B R R B R B B R R R B B B B R B R R B R B B R B R B R B R R R B B B R R B B B R R B R B B B R B B R R B B R R R R B R R B B B R B B B B R B R R B R R R B R R B R R B R R B R B R B B R B ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #29:
score: 0
Accepted
time: 135ms
memory: 8584kb
input:
50000 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #30:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
4 B R R B B
output:
? 1 2 ? 2 3 ? 3 4 ? 4 1 ? 1 3 ! 1 2 4 1 1 3
result:
ok AC
Test #31:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
5 B R R B B B
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 1 ? 1 3 ! 1 2 4 5 5 1 1 3
result:
ok AC
Test #32:
score: 0
Accepted
time: 1ms
memory: 3512kb
input:
6 R R R R B B B B B
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 1 ? 6 2 ? 6 3 ? 6 4 ! 5 6 6 1 6 2 6 3 6 4
result:
ok AC
Test #33:
score: 0
Accepted
time: 169ms
memory: 8804kb
input:
50000 B R R B B B B B R B R R R R R R R B B R R B R B R R B B R B R R R R B R B B B R R R B B R R B R B R B B B R B R R B R B B R R R B B B B R B R R B R B B R B R B R B R R R B B B R R B B B R R B R B B B R B B R R B B R R R R B R R B B B R B B B B R B R R B R R R B R R B R R B R R B R B R B B R B ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #34:
score: 0
Accepted
time: 137ms
memory: 8256kb
input:
50000 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #35:
score: 0
Accepted
time: 91ms
memory: 8324kb
input:
50000 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Test #36:
score: 0
Accepted
time: 79ms
memory: 8148kb
input:
50000 R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R ...
output:
? 1 2 ? 2 3 ? 3 4 ? 4 5 ? 5 6 ? 6 7 ? 7 8 ? 8 9 ? 9 10 ? 10 11 ? 11 12 ? 12 13 ? 13 14 ? 14 15 ? 15 16 ? 16 17 ? 17 18 ? 18 19 ? 19 20 ? 20 21 ? 21 22 ? 22 23 ? 23 24 ? 24 25 ? 25 26 ? 26 27 ? 27 28 ? 28 29 ? 29 30 ? 30 31 ? 31 32 ? 32 33 ? 33 34 ? 34 35 ? 35 36 ? 36 37 ? 37 38 ? 38 39 ? 39 40 ? 40 ...
result:
ok AC
Extra Test:
score: 0
Extra Test Passed