QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#658480 | #9484. Colored Complete Graph | ucup-team4435# | AC ✓ | 151ms | 5332kb | C++20 | 2.2kb | 2024-10-19 16:53:26 | 2024-10-19 16:53:26 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct DSU {
vector<int> fa, sz;
explicit DSU(int n) : fa(n), sz(n, 1) {
iota(fa.begin(), fa.end(), 0);
}
DSU() = default;
int find(int x) {
return fa[x] == x ? x : fa[x] = find(fa[x]);
}
bool same(int a, int b) {
return find(a) == find(b);
}
bool unite(int a, int b) {
a = find(a), b = find(b);
if (a == b) {
return false;
}
if (sz[a] < sz[b]) {
swap(a, b);
}
fa[b] = a;
sz[a] += sz[b];
return true;
}
};
void solve() {
int n;
cin >> n;
vector<int> c[2];
vector<pair<int, int>> edges[2];
// vector adj(n, vector<int>(n));
// for (int i = 0; i < n; ++i) {
// for (int j = i + 1; j < n; ++j) {
// cin >> adj[i][j];
// }
// }
int Q = 0;
auto ask = [&](int i, int j) {
cout << "? " << i + 1 << " " << j + 1 << endl;
Q += 1;
char c;
cin >> c;
assert(c != 'F');
edges[c == 'B'].push_back({i, j});
return c == 'B';
};
for (int x = 0; x < n; ++x) {
c[0].push_back(x);
c[1].push_back(x);
int aim = c[0].size() == 2 ? 0 : 1;
while (c[0].size() > 1 && c[1].size() > 1) {
if (ask(x, c[aim ^ 1].end()[-2]) == aim) {
c[aim] = {x};
break;
} else {
c[aim ^ 1].end()[-2] = x;
c[aim ^ 1].pop_back();
}
}
}
int aim = c[1].size() == 1;
assert(c[0].size() == 1 || c[1].size() == 1);
DSU d(n);
vector<pair<int, int>> e;
for (auto [u, v] : edges[aim]) {
if (d.unite(u, v)) {
e.push_back({u, v});
}
}
assert(e.size() == n - 1);
cout << "!" << endl;
for (auto [u, v] : e) {
cout << u + 1 << " " << v + 1 << endl;
}
// cerr << "Q: " << Q << endl;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int test = 1;
// cin >> test;
while (test--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3548kb
input:
3 B B
output:
? 2 1 ? 3 2 ! 2 1 3 2
result:
ok AC
Test #2:
score: 0
Accepted
time: 2ms
memory: 3528kb
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:
? 2 1 ? 3 2 ? 3 1 ? 4 3 ? 4 2 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 8 6 ? 9 8 ? 9 6 ? 9 5 ? 9 4 ? 9 3 ? 10 9 ? 11 10 ? 12 11 ? 12 10 ? 12 9 ? 13 12 ? 14 13 ? 14 12 ? 15 14 ? 15 12 ? 16 15 ? 17 16 ? 17 15 ? 17 12 ? 18 17 ? 18 12 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 22 20 ? 23 22 ? 23 20 ? 23 19 ? 23 18 ? 24 23 ? 25...
result:
ok AC
Test #3:
score: 0
Accepted
time: 1ms
memory: 3612kb
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
output:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #4:
score: 0
Accepted
time: 3ms
memory: 3560kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #5:
score: 0
Accepted
time: 3ms
memory: 3572kb
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:
? 2 1 ? 3 2 ? 3 1 ? 4 3 ? 4 2 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 8 6 ? 9 8 ? 9 6 ? 9 5 ? 9 4 ? 9 3 ? 10 9 ? 11 10 ? 12 11 ? 12 10 ? 12 9 ? 13 12 ? 14 13 ? 14 12 ? 15 14 ? 15 12 ? 16 15 ? 17 16 ? 17 15 ? 17 12 ? 18 17 ? 18 12 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 22 20 ? 23 22 ? 23 20 ? 23 19 ? 23 18 ? 24 23 ? 25...
result:
ok AC
Test #6:
score: 0
Accepted
time: 1ms
memory: 3528kb
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 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 R B R B R B R B R B R B R B R B R B R B R B
output:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 30 28 ? 30 27 ? 30 26 ? 30 25 ? 30 24 ? 30 23 ? 30 22 ? 30 21 ? 30 20 ? 30 19 ? 30 ...
result:
ok AC
Test #7:
score: 0
Accepted
time: 5ms
memory: 3644kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #8:
score: 0
Accepted
time: 2ms
memory: 3864kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #9:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
47 R R R R R R R B B B B B B B B B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B R B
output:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 9 7 ? 9 6 ? 9 5 ? 9 4 ? 9 3 ? 9 2 ? 9 1 ? 10 9 ? 11 10 ? 11 9 ? 12 11 ? 12 9 ? 13 12 ? 13 9 ? 14 13 ? 14 9 ? 15 14 ? 15 9 ? 16 15 ? 16 9 ? 17 16 ? 17 9 ? 18 17 ? 18 9 ? 19 18 ? 19 9 ? 20 19 ? 20 9 ? 21 20 ? 21 9 ? 22 21 ? 22 9 ? 23 22 ? 23 9 ? 24 23 ...
result:
ok AC
Test #10:
score: 0
Accepted
time: 20ms
memory: 3972kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #11:
score: 0
Accepted
time: 51ms
memory: 3928kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #12:
score: 0
Accepted
time: 34ms
memory: 4044kb
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:
? 2 1 ? 3 2 ? 3 1 ? 4 3 ? 4 2 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 8 6 ? 9 8 ? 9 6 ? 9 5 ? 9 4 ? 9 3 ? 10 9 ? 11 10 ? 12 11 ? 12 10 ? 12 9 ? 13 12 ? 14 13 ? 14 12 ? 15 14 ? 15 12 ? 16 15 ? 17 16 ? 17 15 ? 17 12 ? 18 17 ? 18 12 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 22 20 ? 23 22 ? 23 20 ? 23 19 ? 23 18 ? 24 23 ? 25...
result:
ok AC
Test #13:
score: 0
Accepted
time: 43ms
memory: 4300kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #14:
score: 0
Accepted
time: 39ms
memory: 4160kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #15:
score: 0
Accepted
time: 71ms
memory: 5020kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #16:
score: 0
Accepted
time: 53ms
memory: 4692kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #17:
score: 0
Accepted
time: 90ms
memory: 4952kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #18:
score: 0
Accepted
time: 46ms
memory: 5112kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #19:
score: 0
Accepted
time: 88ms
memory: 5020kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #20:
score: 0
Accepted
time: 55ms
memory: 4652kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #21:
score: 0
Accepted
time: 73ms
memory: 5120kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #22:
score: 0
Accepted
time: 70ms
memory: 4676kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #23:
score: 0
Accepted
time: 139ms
memory: 5268kb
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:
? 2 1 ? 3 2 ? 3 1 ? 4 3 ? 4 2 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 8 6 ? 9 8 ? 9 6 ? 9 5 ? 9 4 ? 9 3 ? 10 9 ? 11 10 ? 12 11 ? 12 10 ? 12 9 ? 13 12 ? 14 13 ? 14 12 ? 15 14 ? 15 12 ? 16 15 ? 17 16 ? 17 15 ? 17 12 ? 18 17 ? 18 12 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 22 20 ? 23 22 ? 23 20 ? 23 19 ? 23 18 ? 24 23 ? 25...
result:
ok AC
Test #24:
score: 0
Accepted
time: 72ms
memory: 4916kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #25:
score: 0
Accepted
time: 80ms
memory: 4952kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #26:
score: 0
Accepted
time: 131ms
memory: 5096kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #27:
score: 0
Accepted
time: 78ms
memory: 5140kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #28:
score: 0
Accepted
time: 151ms
memory: 5148kb
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:
? 2 1 ? 3 2 ? 3 1 ? 4 3 ? 4 2 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 8 6 ? 9 8 ? 9 6 ? 9 5 ? 9 4 ? 9 3 ? 10 9 ? 11 10 ? 12 11 ? 12 10 ? 12 9 ? 13 12 ? 14 13 ? 14 12 ? 15 14 ? 15 12 ? 16 15 ? 17 16 ? 17 15 ? 17 12 ? 18 17 ? 18 12 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 22 20 ? 23 22 ? 23 20 ? 23 19 ? 23 18 ? 24 23 ? 25...
result:
ok AC
Test #29:
score: 0
Accepted
time: 120ms
memory: 5332kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #30:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
4 B R R B B
output:
? 2 1 ? 3 2 ? 3 1 ? 4 3 ? 4 2 ! 2 1 4 3 4 2
result:
ok AC
Test #31:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
5 B R R B B B
output:
? 2 1 ? 3 2 ? 3 1 ? 4 3 ? 4 2 ? 5 4 ! 2 1 4 3 4 2 5 4
result:
ok AC
Test #32:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
6 R R R R B B B B B
output:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 6 4 ? 6 3 ? 6 2 ? 6 1 ! 6 5 6 4 6 3 6 2 6 1
result:
ok AC
Test #33:
score: 0
Accepted
time: 121ms
memory: 5056kb
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:
? 2 1 ? 3 2 ? 3 1 ? 4 3 ? 4 2 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 8 6 ? 9 8 ? 9 6 ? 9 5 ? 9 4 ? 9 3 ? 10 9 ? 11 10 ? 12 11 ? 12 10 ? 12 9 ? 13 12 ? 14 13 ? 14 12 ? 15 14 ? 15 12 ? 16 15 ? 17 16 ? 17 15 ? 17 12 ? 18 17 ? 18 12 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 22 20 ? 23 22 ? 23 20 ? 23 19 ? 23 18 ? 24 23 ? 25...
result:
ok AC
Test #34:
score: 0
Accepted
time: 103ms
memory: 5192kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #35:
score: 0
Accepted
time: 66ms
memory: 4940kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Test #36:
score: 0
Accepted
time: 74ms
memory: 4940kb
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:
? 2 1 ? 3 2 ? 4 3 ? 5 4 ? 6 5 ? 7 6 ? 8 7 ? 9 8 ? 10 9 ? 11 10 ? 12 11 ? 13 12 ? 14 13 ? 15 14 ? 16 15 ? 17 16 ? 18 17 ? 19 18 ? 20 19 ? 21 20 ? 22 21 ? 23 22 ? 24 23 ? 25 24 ? 26 25 ? 27 26 ? 28 27 ? 29 28 ? 30 29 ? 31 30 ? 32 31 ? 33 32 ? 34 33 ? 35 34 ? 36 35 ? 37 36 ? 38 37 ? 39 38 ? 40 39 ? 41 ...
result:
ok AC
Extra Test:
score: 0
Extra Test Passed