QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#745917 | #9432. Permutation | guosoun | AC ✓ | 230ms | 3976kb | C++17 | 2.5kb | 2024-11-14 12:25:29 | 2024-11-14 12:25:30 |
Judging History
answer
#include <bits/stdc++.h>
using ll = long long;
struct hope {
int n;
std::vector<int> p;
hope(int n) : n(n), p(n) {
std::iota(p.begin(), p.end(), 0);
std::shuffle(p.begin(), p.end(), std::mt19937());
for (int i : p) std::cerr << i << ' ';
std::cerr << '\n';
}
int query(std::vector<int> a) {
auto na = a;
for (int i = 0; i < n; i++) na[p[i]] = a[i];
std::cout << 0 << ' ';
for (int i : na) std::cout << i << ' ';
std::cout << std::endl;
int ret;
std::cin >> ret;
return ret;
}
void answer(std::vector<int> a) {
auto na = a;
for (int i = 0; i < n; i++) na[p[i]] = a[i];
std::cout << 1 << ' ';
for (int i : na) std::cout << i << ' ';
std::cout << std::endl;
}
};
int main() {
std::cin.tie(0)->sync_with_stdio(0);
int n;
std::cin >> n;
hope ia(n);
if (n == 1) return ia.answer({1}), 0;
std::vector<int> a(n);
auto solve = [&](auto &self, int l, int r, std::vector<int> v) {
assert((int)v.size() == r - l + 1);
if (l == r) return a[l] = v[0], void();
int mid = (l + r) >> 1;
std::vector<std::vector<int>> cv;
std::vector<int> lv, rv;
for (int i : v) cv.push_back({i});
while (cv.size()) {
if (cv.size() == 1) {
auto a = cv[0];
cv.pop_back();
int ev = -1;
if (lv.size()) ev = lv[0];
else {
for (int i = 1; i <= n; i++)
if (std::find(v.begin(), v.end(), i) == v.end())
ev = i;
}
assert(ev != -1);
std::vector<int> q(n, ev);
for (int i = l; i <= mid; i++) q[i] = a[0];
if (ia.query(q))
lv.insert(lv.end(), a.begin(), a.end());
else
rv.insert(rv.end(), a.begin(), a.end());
continue;
}
auto a = cv.back();
cv.pop_back();
auto b = cv.back();
cv.pop_back();
std::vector<int> q(n, a[0]);
for (int i = mid + 1; i <= r; i++) q[i] = b[0];
if (int t = ia.query(q); t == 1) {
a.insert(a.end(), b.begin(), b.end());
cv.push_back(a);
} else if (t == 2) {
lv.insert(lv.end(), a.begin(), a.end());
rv.insert(rv.end(), b.begin(), b.end());
} else {
lv.insert(lv.end(), b.begin(), b.end());
rv.insert(rv.end(), a.begin(), a.end());
}
}
self(self, l, mid, lv);
self(self, mid + 1, r, rv);
};
std::vector<int> v(n);
std::iota(v.begin(), v.end(), 1);
solve(solve, 0, n - 1, v);
ia.answer(a);
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3836kb
input:
5 2 0 1 1 2 0 2
output:
0 4 4 5 5 5 0 2 2 3 3 3 0 5 5 1 1 1 0 1 1 1 1 2 0 1 1 1 1 5 0 2 2 1 2 2 0 3 4 3 3 3 1 3 4 2 1 5
result:
ok Accepted
Test #2:
score: 0
Accepted
time: 228ms
memory: 3712kb
input:
1000 0 1 2 1 1 1 1 1 0 2 1 1 2 2 0 1 0 1 0 1 1 1 0 2 1 2 0 0 2 0 1 1 0 0 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 1 1 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 1 1 0 1 1 0 2 1 2 0 0 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 1 1 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1...
output:
0 1000 1000 1000 1000 1000 999 999 1000 999 999 1000 999 999 999 999 1000 1000 1000 1000 1000 999 1000 1000 1000 999 1000 999 1000 999 999 1000 999 999 999 1000 999 999 999 999 999 1000 1000 1000 1000 999 1000 999 999 999 1000 1000 1000 1000 1000 1000 999 1000 999 999 999 999 1000 1000 999 999 999 9...
result:
ok Accepted
Test #3:
score: 0
Accepted
time: 1ms
memory: 3860kb
input:
1
output:
1 1
result:
ok Accepted
Test #4:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
2 2
output:
0 2 1 1 2 1
result:
ok Accepted
Test #5:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
3 1 2 0
output:
0 3 2 3 0 3 1 3 0 2 2 3 1 3 1 2
result:
ok Accepted
Test #6:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
4 1 0 1 0 2
output:
0 3 3 4 4 0 2 2 4 4 0 2 2 1 1 0 1 1 1 2 0 3 4 3 3 1 3 4 2 1
result:
ok Accepted
Test #7:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
6 1 1 0 1 1 1 2 2 0 1 0
output:
0 6 5 6 6 5 5 0 6 4 6 6 4 4 0 6 3 6 6 3 3 0 2 1 2 2 1 1 0 2 3 2 2 3 3 0 2 1 1 1 1 1 0 3 1 1 1 1 1 0 2 2 2 1 2 2 0 4 5 4 4 4 4 0 5 5 5 5 6 6 0 6 6 6 6 5 6 1 3 4 2 1 6 5
result:
ok Accepted
Test #8:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
7 0 0 0 1 1 2 0 0 2 0 1 2
output:
0 6 6 7 7 7 6 7 0 4 4 5 5 5 4 5 0 2 2 3 3 3 2 3 0 6 6 1 1 1 6 1 0 1 1 1 1 2 1 2 0 1 1 1 1 4 1 4 0 1 1 6 6 1 1 1 0 2 2 1 2 2 2 2 0 6 6 6 6 6 6 4 0 5 3 3 3 3 3 3 0 5 7 5 5 5 7 5 0 7 7 7 7 7 5 7 1 3 7 2 1 6 5 4
result:
ok Accepted
Test #9:
score: 0
Accepted
time: 1ms
memory: 3520kb
input:
8 1 1 0 0 1 1 1 2 0 2 0 1 2 0 2 2
output:
0 8 7 8 8 7 8 7 7 0 8 6 8 8 6 8 6 6 0 8 5 8 8 5 8 5 5 0 4 3 4 4 3 4 3 3 0 2 1 2 2 1 2 1 1 0 2 5 2 2 5 2 5 5 0 2 1 1 1 1 2 1 1 0 3 1 1 1 1 3 1 1 0 1 1 5 5 1 1 1 1 0 2 2 2 1 2 2 2 2 0 5 5 5 5 5 3 5 5 0 4 6 4 4 4 4 4 6 0 4 7 4 4 4 4 4 7 0 4 4 4 4 8 4 8 4 0 6 6 6 6 6 6 4 6 0 8 7 8 8 8 8 8...
result:
ok Accepted
Test #10:
score: 0
Accepted
time: 1ms
memory: 3516kb
input:
9 2 2 0 0 1 1 2 0 0 1 2 0 0 2 0 0
output:
0 8 9 9 9 9 8 9 8 8 0 6 7 7 7 7 6 7 6 6 0 4 5 5 5 5 4 5 4 4 0 2 3 3 3 3 2 3 2 2 0 9 1 1 1 1 9 1 9 9 0 1 2 1 1 1 1 2 1 1 0 1 4 1 1 1 1 4 1 1 0 7 9 7 7 7 7 9 7 7 0 9 9 9 9 2 9 9 9 9 0 2 2 1 1 2 2 2 2 2 0 1 1 2 1 1 1 1 1 1 0 7 4 7 7 7 7 7 7 7 0 5 3 3 3 3 3 3 5 3 0 8 6 6 6 6 6 6 8 6 0 6 6 ...
result:
ok Accepted
Test #11:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
10 1 2 1 0 0 2 1 2 0 2 1 0 0 0 0 1 2 1 2 0
output:
0 10 9 10 9 10 10 9 9 9 10 0 10 8 10 8 10 10 8 8 8 10 0 7 6 7 6 7 7 6 6 6 7 0 7 5 7 5 7 7 5 5 5 7 0 4 3 4 3 4 4 3 3 3 4 0 2 1 2 1 2 2 1 1 1 2 0 2 2 2 2 3 3 2 2 2 2 0 2 2 2 2 5 5 2 2 2 2 0 9 9 9 9 10 10 9 9 9 9 0 3 10 10 10 10 10 10 10 10 10 0 10 10 2 10 10 10 10 10 10 2 0 2 2 2 2 2 2 2 2 ...
result:
ok Accepted
Test #12:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
11 1 1 0 2 1 2 1 1 1 2 1 0 0 1 2 2 1 2 1 2 0 0 1 0 2
output:
0 10 11 10 11 10 11 11 10 10 11 11 0 9 11 9 11 9 11 11 9 9 11 11 0 8 11 8 11 8 11 11 8 8 11 11 0 6 7 6 7 6 7 7 6 6 7 7 0 4 5 4 5 4 5 5 4 4 5 5 0 3 5 3 5 3 5 5 3 3 5 5 0 1 2 1 2 1 2 2 1 1 2 2 0 8 2 8 2 8 2 2 8 8 2 2 0 1 2 1 1 1 2 2 1 1 1 1 0 1 4 1 1 1 4 4 1 1 1 1 0 5 7 5 5 5 7 7 5 5 5 5 0 ...
result:
ok Accepted
Test #13:
score: 0
Accepted
time: 1ms
memory: 3828kb
input:
12 1 0 2 1 0 1 1 2 1 2 1 0 2 1 0 1 2 2 1 2 0 0 1 2 0 1 2 0
output:
0 12 11 12 11 12 12 12 11 11 12 11 11 0 12 10 12 10 12 12 12 10 10 12 10 10 0 9 8 9 8 9 9 9 8 8 9 8 8 0 7 6 7 6 7 7 7 6 6 7 6 6 0 7 5 7 5 7 7 7 5 5 7 5 5 0 4 3 4 3 4 4 4 3 3 4 3 3 0 4 2 4 2 4 4 4 2 2 4 2 2 0 4 1 4 1 4 4 4 1 1 4 1 1 0 2 2 2 2 3 3 3 2 2 2 2 2 0 2 2 2 2 4 4 4 2 2 2 2 2 0 5 5 ...
result:
ok Accepted
Test #14:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
13 0 1 1 0 2 1 2 1 1 1 1 2 0 0 1 0 1 2 0 0 1 0 2 0 0 2 1 0 0 1 0
output:
0 12 13 12 13 12 13 13 12 13 13 13 12 12 0 10 11 10 11 10 11 11 10 11 11 11 10 10 0 9 11 9 11 9 11 11 9 11 11 11 9 9 0 8 11 8 11 8 11 11 8 11 11 11 8 8 0 6 7 6 7 6 7 7 6 7 7 7 6 6 0 4 5 4 5 4 5 5 4 5 5 5 4 4 0 3 5 3 5 3 5 5 3 5 5 5 3 3 0 1 2 1 2 1 2 2 1 2 2 2 1 1 0 12 2 12 2 12 2 2 12 2 2 2 ...
result:
ok Accepted
Test #15:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
14 1 2 1 1 2 1 1 0 0 0 2 0 0 1 1 0 1 0 2 0 1 0 2 0 0 1 1 0 1 0 0 0 1 2
output:
0 14 13 14 13 14 14 14 14 13 14 13 13 13 13 0 14 12 14 12 14 14 14 14 12 14 12 12 12 12 0 11 10 11 10 11 11 11 11 10 11 10 10 10 10 0 11 9 11 9 11 11 11 11 9 11 9 9 9 9 0 11 8 11 8 11 11 11 11 8 11 8 8 8 8 0 7 6 7 6 7 7 7 7 6 7 6 6 6 6 0 7 5 7 5 7 7 7 7 5 7 5 5 5 5 0 7 4 7 4 7 7 7 7 4 7 4 4 4...
result:
ok Accepted
Test #16:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
15 2 1 2 1 0 2 0 0 1 1 1 2 2 1 0 1 0 1 2 0 2 0 2 2 2 0 2 1 0 0 2 2 2 1 2
output:
0 15 15 14 15 14 15 15 14 15 15 15 14 14 14 14 0 13 13 12 13 12 13 13 12 13 13 13 12 12 12 12 0 13 13 11 13 11 13 13 11 13 13 13 11 11 11 11 0 10 10 9 10 9 10 10 9 10 10 10 9 9 9 9 0 10 10 8 10 8 10 10 8 10 10 10 8 8 8 8 0 7 7 6 7 6 7 7 6 7 7 7 6 6 6 6 0 5 5 4 5 4 5 5 4 5 5 5 4 4 4 4 0 3 3 2 ...
result:
ok Accepted
Test #17:
score: 0
Accepted
time: 216ms
memory: 3692kb
input:
975 0 1 1 1 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 0 0 0 2 0 2 1 1 0 0 0 0 0 0 1 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 0 1 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 2 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 1 1 1 1 2 1 1 2 2 1 1 1 1 0 0 ...
output:
0 975 974 974 974 974 975 975 975 975 974 974 975 974 975 975 975 975 974 974 975 975 975 974 975 975 974 974 974 974 974 974 974 974 974 974 975 975 975 974 975 975 975 974 974 975 974 975 974 974 975 975 974 975 974 975 975 974 975 975 975 975 975 975 975 974 974 974 975 974 975 975 975 974 974 97...
result:
ok Accepted
Test #18:
score: 0
Accepted
time: 220ms
memory: 3748kb
input:
976 2 0 0 1 0 2 1 2 0 0 2 0 1 1 0 1 1 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 0 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 0 0 1 0 1 2 1 2 0 1 1 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 1 0 0 1 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 1 1 1 1 1 2 1 2 1 0 2 0 0 1 1 2 1 ...
output:
0 976 976 976 976 976 975 975 976 975 975 975 975 976 975 975 976 976 976 976 976 975 976 976 976 976 976 975 975 975 975 976 975 975 975 976 975 975 975 975 975 976 976 976 976 975 976 975 975 975 976 976 976 976 976 976 975 976 975 975 975 975 976 976 975 975 975 975 976 976 975 976 975 976 976 97...
result:
ok Accepted
Test #19:
score: 0
Accepted
time: 219ms
memory: 3684kb
input:
977 2 0 1 1 1 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 0 0 0 2 0 2 1 1 0 0 0 0 0 0 1 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 0 1 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 2 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 1 1 1 1 2 1 1 2 2 1 1 1 1 0 ...
output:
0 977 976 976 976 976 977 977 977 977 976 976 977 976 977 977 977 977 976 976 977 977 977 976 977 977 976 976 976 976 976 976 976 976 976 976 977 977 977 976 977 977 977 976 976 977 976 977 976 976 977 977 976 977 976 977 977 976 977 977 977 977 977 977 977 976 976 976 977 976 977 977 977 976 976 97...
result:
ok Accepted
Test #20:
score: 0
Accepted
time: 205ms
memory: 3940kb
input:
978 1 0 1 0 0 1 0 2 1 2 0 0 2 0 1 1 0 1 1 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 0 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 0 0 1 1 0 2 1 2 0 1 1 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 2 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 1 1 1 1 1 2 1 2 1 0 2 0 0 1 1 2 ...
output:
0 978 978 978 978 978 977 977 978 977 977 977 977 978 977 977 978 978 978 978 978 977 978 978 978 978 978 977 978 977 977 978 977 977 977 978 977 977 977 977 977 978 978 978 978 977 978 977 977 977 978 978 978 978 978 978 977 978 977 977 977 977 978 978 977 977 977 977 978 978 977 978 977 978 978 97...
result:
ok Accepted
Test #21:
score: 0
Accepted
time: 218ms
memory: 3760kb
input:
979 2 2 0 1 1 1 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 0 0 0 2 0 2 1 1 0 0 0 0 0 0 1 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 0 1 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 2 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 1 1 1 1 2 1 1 2 2 1 1 1 1 ...
output:
0 979 978 978 978 978 979 979 979 979 978 978 979 978 979 979 979 979 978 978 979 979 979 978 979 979 978 978 978 978 978 978 978 978 978 978 979 979 979 978 979 979 979 978 978 979 978 979 978 978 979 979 978 979 978 979 979 978 979 979 979 978 979 979 979 978 978 978 979 978 979 979 979 978 978 97...
result:
ok Accepted
Test #22:
score: 0
Accepted
time: 221ms
memory: 3628kb
input:
980 0 1 0 1 0 0 1 0 2 1 2 0 0 2 0 1 1 0 1 1 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 0 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 0 0 1 1 0 2 1 2 0 1 1 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 1 1 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 1 1 1 1 1 2 1 2 1 0 2 0 0 1 ...
output:
0 980 980 980 980 980 979 979 980 979 979 979 979 979 979 979 980 980 980 980 980 979 980 980 980 980 980 979 980 979 979 980 979 979 979 980 979 979 979 979 979 980 980 980 980 979 980 979 979 979 980 980 980 980 980 980 979 980 979 979 979 979 980 980 979 979 979 979 980 980 979 980 979 980 980 97...
result:
ok Accepted
Test #23:
score: 0
Accepted
time: 194ms
memory: 3684kb
input:
981 1 1 2 2 0 1 1 1 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 0 0 0 2 0 2 1 1 0 0 0 0 0 0 1 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 0 1 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 2 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 1 1 1 1 2 1 1 2 2 1 1 ...
output:
0 981 980 980 980 980 981 981 981 981 980 981 981 980 981 981 981 981 980 980 981 981 981 980 981 981 980 980 980 980 980 980 980 980 980 980 981 981 981 980 981 981 981 980 980 981 980 981 980 980 981 981 980 981 980 981 981 980 981 981 981 980 981 981 981 980 980 980 981 980 981 981 981 980 980 98...
result:
ok Accepted
Test #24:
score: 0
Accepted
time: 219ms
memory: 3696kb
input:
982 2 0 1 0 1 0 1 1 1 0 2 1 2 0 0 2 0 1 1 0 1 1 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 0 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 0 0 1 1 0 2 1 2 0 1 1 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 1 1 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 1 1 1 1 1 2 1 2 1 0 2 0 ...
output:
0 982 982 982 982 982 981 981 982 981 981 982 981 981 981 981 982 982 982 982 982 981 982 982 982 982 982 981 982 981 981 982 981 981 981 982 981 981 981 981 981 982 982 982 982 981 982 981 981 981 982 982 982 982 982 982 981 982 981 981 981 981 982 982 981 981 981 981 982 982 981 982 981 982 982 98...
result:
ok Accepted
Test #25:
score: 0
Accepted
time: 206ms
memory: 3744kb
input:
983 0 1 1 2 2 0 1 1 1 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 0 0 0 2 0 2 1 1 0 0 0 0 0 0 1 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 0 1 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 2 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 1 1 1 1 2 1 1 2 2 1 ...
output:
0 983 982 982 982 982 983 983 983 983 982 983 983 982 983 983 983 983 982 982 983 983 983 982 983 983 982 982 982 982 982 982 982 982 982 982 983 983 983 982 983 983 983 982 982 983 982 983 982 982 983 983 982 983 982 983 983 982 983 983 983 982 983 983 983 982 982 982 983 982 983 983 983 982 982 98...
result:
ok Accepted
Test #26:
score: 0
Accepted
time: 217ms
memory: 3684kb
input:
984 2 2 0 1 0 1 0 1 1 1 0 2 1 2 0 0 2 0 1 1 0 1 1 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 0 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 0 0 1 1 0 2 1 2 0 1 1 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 1 1 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 1 1 1 1 1 2 1 2 1 0 2 ...
output:
0 984 984 984 984 984 983 983 984 983 983 984 983 983 983 983 984 984 984 984 984 983 984 984 984 984 984 983 984 983 983 984 983 983 983 984 983 983 983 983 983 984 984 984 984 983 984 983 983 983 984 984 984 984 984 984 983 984 983 983 983 983 984 984 983 983 983 983 984 984 983 984 983 984 984 98...
result:
ok Accepted
Test #27:
score: 0
Accepted
time: 224ms
memory: 3680kb
input:
985 1 2 1 1 1 2 2 0 1 1 1 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 0 0 0 2 0 2 1 1 0 0 0 0 0 0 1 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 1 0 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 2 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 1 1 1 1 2 1 1 2 ...
output:
0 985 984 984 984 984 985 985 985 985 984 985 985 984 985 985 985 985 984 984 985 985 985 984 985 985 984 984 984 984 984 984 984 984 984 984 985 985 985 984 985 985 985 984 984 985 984 985 984 984 985 985 984 985 984 985 985 984 985 985 985 984 985 985 985 984 984 984 985 984 985 985 985 984 984 98...
result:
ok Accepted
Test #28:
score: 0
Accepted
time: 206ms
memory: 3764kb
input:
986 1 1 2 2 0 1 0 1 0 1 1 1 0 2 1 2 0 0 2 0 1 1 0 1 1 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 0 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 0 0 1 1 0 2 1 2 0 1 1 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 1 1 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 1 1 1 1 1 2 1 2 1 ...
output:
0 986 986 986 986 986 985 985 986 985 985 986 985 985 985 985 986 986 986 986 986 985 986 986 986 985 986 985 986 985 985 986 985 985 985 986 985 985 985 985 985 986 986 986 986 985 986 985 985 985 986 986 986 986 986 986 985 986 985 985 985 985 986 986 985 985 985 985 986 986 985 986 985 986 986 98...
result:
ok Accepted
Test #29:
score: 0
Accepted
time: 228ms
memory: 3680kb
input:
987 0 1 2 1 1 1 2 2 0 1 1 1 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 0 0 0 2 0 2 1 1 0 0 0 0 1 2 2 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 1 0 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 2 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 1 1 1 1 2 1 1 ...
output:
0 987 986 986 986 986 987 987 987 987 986 987 987 986 987 987 987 987 986 986 987 987 987 986 987 987 986 986 986 986 986 986 986 986 986 986 987 987 987 986 987 987 987 986 986 987 986 987 986 986 987 987 986 987 986 987 987 986 987 987 987 986 987 987 987 986 986 986 987 986 987 987 987 986 986 98...
result:
ok Accepted
Test #30:
score: 0
Accepted
time: 210ms
memory: 3940kb
input:
988 2 1 1 2 2 0 1 0 1 0 1 1 1 0 2 1 2 0 0 2 0 1 1 0 1 1 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 0 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 0 0 1 1 0 2 1 2 0 0 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 1 1 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 1 1 1 1 1 2 1 2 1 ...
output:
0 988 988 988 988 988 987 987 988 987 987 988 987 987 987 987 988 988 988 988 988 987 988 988 988 987 988 987 988 987 987 988 987 987 987 988 987 987 987 987 987 988 988 988 988 987 988 987 987 987 988 988 988 988 988 988 987 988 987 987 987 987 988 988 987 987 987 987 988 988 987 988 987 988 988 98...
result:
ok Accepted
Test #31:
score: 0
Accepted
time: 176ms
memory: 3936kb
input:
989 1 2 1 1 2 1 1 1 2 2 0 2 1 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 1 1 0 0 2 0 2 1 1 0 0 0 0 1 2 2 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 1 0 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 2 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 1 1 1 1 2 ...
output:
0 989 988 988 988 988 989 989 989 989 988 989 989 988 989 989 989 989 988 988 989 989 989 988 989 989 988 988 988 988 988 988 988 988 988 988 988 989 989 988 989 989 989 988 988 989 988 989 988 988 989 989 988 989 988 989 989 988 989 989 989 988 989 989 989 988 988 988 989 988 989 989 989 988 988 98...
result:
ok Accepted
Test #32:
score: 0
Accepted
time: 218ms
memory: 3756kb
input:
990 0 2 1 1 2 2 0 1 0 1 0 1 1 1 0 2 1 2 0 0 2 0 1 1 0 1 1 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 0 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 0 0 1 1 0 2 1 2 0 0 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 1 1 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 1 1 1 1 1 2 1 2 ...
output:
0 990 990 990 990 990 989 989 990 989 989 990 989 989 989 989 990 990 990 990 990 989 990 990 990 989 990 989 990 989 989 990 989 989 989 990 989 989 989 989 989 990 990 990 990 989 990 989 989 989 990 990 990 990 990 990 989 990 989 989 989 989 990 990 989 989 989 989 990 990 989 990 989 990 990 98...
result:
ok Accepted
Test #33:
score: 0
Accepted
time: 211ms
memory: 3740kb
input:
991 1 0 2 1 1 2 1 1 1 2 2 0 2 1 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 1 1 0 0 2 0 2 1 1 0 0 0 0 1 2 2 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 1 0 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 2 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 1 1 1 1 ...
output:
0 991 990 990 990 990 991 991 991 991 990 991 991 990 991 991 991 991 990 990 991 991 991 990 991 991 990 990 990 990 990 990 990 990 990 990 990 991 991 990 991 991 991 990 990 991 990 991 990 990 991 991 990 991 990 991 991 990 991 991 991 990 991 991 991 990 990 990 991 990 991 991 991 990 990 99...
result:
ok Accepted
Test #34:
score: 0
Accepted
time: 211ms
memory: 3976kb
input:
992 1 1 0 2 1 1 2 2 0 1 0 1 0 1 1 1 0 2 1 2 0 0 2 0 1 1 0 1 1 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 0 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 1 1 0 1 1 0 2 1 2 0 0 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 1 1 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 1 1 1 1 1 ...
output:
0 992 992 992 992 992 991 991 992 991 991 992 991 991 991 991 992 992 992 992 992 991 992 992 992 991 992 991 992 991 991 992 991 991 991 992 991 991 991 991 991 992 992 992 992 991 992 991 991 991 992 992 992 992 992 992 991 992 991 991 991 991 992 992 991 991 991 991 992 992 991 992 991 992 992 99...
result:
ok Accepted
Test #35:
score: 0
Accepted
time: 213ms
memory: 3912kb
input:
993 0 1 0 2 1 1 2 1 1 1 2 2 0 1 0 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 1 1 0 0 2 0 2 1 1 0 0 0 0 1 2 2 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 1 0 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 1 1 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 1 1 ...
output:
0 993 992 992 992 992 993 993 993 993 992 993 993 992 993 993 993 993 992 992 993 993 993 992 993 993 992 992 992 992 992 992 992 992 992 992 992 993 993 992 993 993 993 992 992 993 992 993 992 992 993 993 992 993 992 993 993 992 993 993 993 992 993 993 993 992 992 992 993 992 993 993 993 992 992 99...
result:
ok Accepted
Test #36:
score: 0
Accepted
time: 211ms
memory: 3636kb
input:
994 1 1 1 1 0 2 1 1 2 2 0 1 0 1 0 1 1 1 0 2 1 2 0 0 2 0 1 1 0 1 1 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 0 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 1 1 0 1 1 0 2 1 2 0 0 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 1 1 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 1 1 1 ...
output:
0 994 994 994 994 994 993 993 994 993 993 994 993 993 993 993 994 994 994 994 994 993 994 994 994 993 994 993 994 993 993 994 993 993 993 994 993 993 993 993 993 994 994 994 994 993 994 993 993 993 994 994 994 994 994 994 993 994 993 993 993 993 994 994 993 993 993 993 994 994 993 994 993 994 994 99...
result:
ok Accepted
Test #37:
score: 0
Accepted
time: 216ms
memory: 3672kb
input:
995 1 2 2 0 2 1 1 2 1 1 1 2 2 0 1 0 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 1 1 0 0 2 0 2 1 1 0 0 0 0 1 2 2 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 1 0 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 1 1 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 1 ...
output:
0 995 994 994 994 994 995 995 995 995 994 995 995 994 995 995 995 995 994 994 995 995 995 994 995 995 994 994 994 994 994 994 994 994 994 994 994 995 995 994 995 995 995 994 994 995 994 995 994 994 995 995 994 995 994 995 995 994 995 995 995 994 995 995 995 994 994 994 995 994 995 995 995 994 994 99...
result:
ok Accepted
Test #38:
score: 0
Accepted
time: 206ms
memory: 3644kb
input:
996 1 1 1 1 1 1 0 2 1 1 2 2 0 1 0 1 0 1 1 1 0 2 1 2 0 0 2 0 1 1 0 1 1 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 0 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 1 1 0 1 1 0 2 1 2 0 0 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 1 1 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 1 ...
output:
0 996 996 996 996 996 995 995 996 995 995 996 995 995 995 995 996 996 996 996 996 995 996 996 996 995 996 995 996 995 995 996 995 995 995 996 995 995 995 995 995 996 996 996 996 995 996 995 995 995 996 996 996 996 996 996 995 996 995 995 995 995 996 996 995 995 995 995 996 996 995 996 995 996 996 99...
result:
ok Accepted
Test #39:
score: 0
Accepted
time: 230ms
memory: 3976kb
input:
997 2 1 2 2 0 2 1 1 2 1 1 1 2 1 2 2 0 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 1 1 0 0 2 0 2 1 1 0 0 0 0 1 2 2 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 1 0 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 1 1 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 1 ...
output:
0 997 996 996 996 996 997 997 997 997 996 997 997 996 997 997 997 997 996 996 997 997 997 996 997 997 996 996 996 996 996 996 996 996 996 996 996 997 997 996 997 997 997 996 996 997 996 997 996 996 997 997 996 997 996 997 997 996 997 997 997 996 997 997 997 996 996 996 997 996 997 997 997 996 996 99...
result:
ok Accepted
Test #40:
score: 0
Accepted
time: 197ms
memory: 3664kb
input:
998 1 2 1 1 1 1 1 0 2 1 1 2 2 0 1 0 1 0 1 1 1 0 2 1 2 0 0 2 0 1 1 0 0 1 2 0 2 0 1 1 1 0 1 1 0 0 2 2 2 1 1 2 0 0 1 1 0 0 1 1 1 0 2 1 1 1 2 1 1 1 1 0 1 1 0 2 1 2 0 0 1 1 2 1 2 1 1 1 0 0 2 1 0 2 0 1 1 1 1 0 1 1 2 0 0 2 1 1 1 1 2 0 0 0 1 0 0 1 1 1 0 0 1 1 2 1 2 1 1 2 0 2 0 1 0 0 2 2 1 2 0 2 1 1 2 2 1 2 ...
output:
0 998 998 998 998 998 997 997 998 997 997 998 997 997 997 997 998 998 998 998 998 997 998 998 998 997 998 997 998 997 997 998 997 997 997 998 997 997 997 997 997 998 998 998 998 997 998 997 997 997 998 998 998 998 998 998 997 998 997 997 997 997 998 998 997 997 997 997 998 998 997 998 997 997 998 99...
result:
ok Accepted
Test #41:
score: 0
Accepted
time: 213ms
memory: 3744kb
input:
999 2 2 1 2 2 0 2 1 1 2 1 1 1 2 1 2 2 0 2 2 1 1 1 1 2 1 1 1 2 0 1 0 1 0 0 1 1 1 0 2 1 1 0 2 1 2 0 2 1 1 0 0 0 0 1 2 2 0 1 0 2 0 1 0 1 0 1 1 0 1 2 1 1 0 2 2 0 1 1 1 1 0 2 1 1 1 1 1 0 0 1 1 2 1 0 1 0 2 1 0 2 0 1 1 2 1 0 1 2 2 2 0 1 1 2 2 2 1 1 1 2 2 2 2 0 1 0 1 1 0 1 0 1 1 1 2 0 1 1 0 0 1 1 0 2 1 1 2 ...
output:
0 999 998 998 998 998 999 999 999 999 998 999 999 998 999 999 999 999 998 998 999 999 999 998 999 999 998 998 998 998 998 998 998 998 998 998 998 999 999 998 999 999 999 998 998 999 998 999 998 998 999 999 998 999 998 999 999 998 999 999 999 998 999 999 999 998 998 998 999 998 999 999 999 998 998 99...
result:
ok Accepted
Extra Test:
score: 0
Extra Test Passed