QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#393831 | #5567. Balanced Permutations | APJifengc | WA | 17ms | 9684kb | C++14 | 6.4kb | 2024-04-19 14:18:35 | 2024-04-19 14:18:36 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005, MAXB = 52, B = 50;
const long long inf = LLONG_MAX / 2;
struct Number {
long long val;
Number(long long x = 0) : val(x) {}
operator long long() { return val; }
Number operator+(Number x) { return min(inf, val + x.val); }
Number operator*(Number x) {
__int128_t v = ((__int128_t) val) * x.val;
if (v <= inf) return v;
return inf;
}
void operator+=(Number x) { val = min(inf, val + x.val); }
};
int n;
long long k1, k2;
long long f[MAXN];
Number g[MAXN];
int t[MAXN];
Number C[MAXB][MAXB];
namespace Small {
int ans[MAXN];
void ss(int l, int r, int a, int b) {
if (l > r) return;
int len = r - l + 1;
int mid = l + t[len], vmid = a + t[len];
if (len > 1 && t[len] == t[len - 1]) mid++, vmid++;
ss(l, mid - 1, a, vmid - 1), ss(mid + 1, r, vmid, b - 1);
ans[mid] = b;
}
bool used[MAXN];
int pos[MAXN];
Number f[MAXB][MAXB][MAXB];
bool vis[MAXB][MAXB][MAXB];
int L;
Number calc(int l, int r, int a, int b, int c) {
if (c < 0) return 0;
if (l > r) return 1;
if (a > b) return 0;
if (vis[l - L][r - L][b - a]) return f[l - L][r - L][b - a];
vis[l - L][r - L][b - a] = 1, f[l - L][r - L][b - a] = 0;
auto &ret = f[l - L][r - L][b - a];
int len = r - l + 1;
if (!used[b]) {
ret += calc(l, r, a, b - 1, c - 1);
for (int i = l + t[len]; i <= r - t[len]; i++) if (!ans[i]) {
ret += calc(l, i - 1, a, b - 1, c + r - i) * g[r - i] * C[c + r - i][c];
}
} else {
if (pos[b] < l) ret += calc(l, r, a, b - 1, c);
else if (pos[b] >= l + t[len] && pos[b] <= r - t[len]) ret += calc(pos[b] + 1, r, a, b - 1, c);
} return ret;
}
void dfs(int l, int r, int a, int b) {
int len = r - l + 1;
if (len <= B) {
for (int i = l; i <= r; i++) {
for (int j = a; j <= b; j++) if (!used[j]) {
ans[i] = j;
pos[j] = i;
used[j] = 1;
L = l;
memset(vis, 0, sizeof vis);
Number w = calc(l, r, a, b, 0);
if (w < k1) {
k1 -= w;
used[j] = 0;
pos[j] = 0;
} else {
break;
}
}
}
} else {
int mid = l + t[len], vmid = a + t[len];
if (len > 1 && t[len] == t[len - 1]) mid++, vmid++;
ss(l, mid - 1, a, vmid - 1);
ans[mid] = b;
dfs(mid + 1, r, vmid, b - 1);
}
}
void solve() {
if (n <= B && k1 > g[n]) printf("-1\n");
else {
dfs(1, n, 1, n);
for (int i = 1; i <= n; i++) printf("%d ", ans[i]); printf("\n");
}
}
}
namespace Bigger {
int ans[MAXN];
void ss(int l, int r, int a, int b) {
if (l > r) return;
int len = r - l + 1;
int mid = l + t[len], vmid = b - t[len];
ss(l, mid - 1, vmid, b - 1), ss(mid + 1, r, a, vmid - 1);
ans[mid] = b;
}
bool used[MAXN];
int pos[MAXN];
Number f[MAXB][MAXB][MAXB];
bool vis[MAXB][MAXB][MAXB];
int L;
Number calc(int l, int r, int a, int b, int c) {
if (c < 0) return 0;
if (l > r) return 1;
if (a > b) return 0;
if (vis[l - L][r - L][b - a]) return f[l - L][r - L][b - a];
vis[l - L][r - L][b - a] = 1, f[l - L][r - L][b - a] = 0;
auto &ret = f[l - L][r - L][b - a];
int len = r - l + 1;
if (!used[b]) {
ret += calc(l, r, a, b - 1, c - 1);
for (int i = l + t[len]; i <= r - t[len]; i++) if (!ans[i]) {
ret += calc(l, i - 1, a, b - 1, c + r - i) * g[r - i] * C[c + r - i][c];
}
} else {
if (pos[b] < l) ret += calc(l, r, a, b - 1, c);
else if (pos[b] >= l + t[len] && pos[b] <= r - t[len]) ret += calc(pos[b] + 1, r, a, b - 1, c);
} return ret;
}
void dfs(int l, int r, int a, int b) {
int len = r - l + 1;
if (len <= B) {
for (int i = l; i <= r; i++) {
for (int j = b; j >= a; j--) if (!used[j]) {
ans[i] = j;
pos[j] = i;
used[j] = 1;
L = l;
memset(vis, 0, sizeof vis);
Number w = calc(l, r, a, b, 0);
if (w < k2) {
k2 -= w;
used[j] = 0;
pos[j] = 0;
} else {
break;
}
}
}
} else {
int mid = l + t[len], vmid = b - t[len];
ss(l, mid - 1, vmid, b - 1);
ans[mid] = b;
dfs(mid + 1, r, a, vmid - 1);
}
}
void solve() {
if (n <= B && k2 > g[n]) printf("-1\n");
else {
dfs(1, n, 1, n);
for (int i = 1; i <= n; i++) printf("%d ", ans[i]); printf("\n");
}
}
}
int main() {
scanf("%d%lld%lld", &n, &k1, &k2);
C[0][0] = 1;
g[0] = 1;
for (int i = 1; i <= n; i++) {
f[i] = i + f[(i - 1) >> 1] + f[i >> 1];
int l = 0, r = (i - 1) >> 1;
while (l < r) {
int mid = (l + r) >> 1;
if (i + f[mid] + f[i - mid - 1] == f[i]) r = mid;
else l = mid + 1;
}
t[i] = l;
if (i <= B) {
C[i][0] = 1;
for (int j = 1; j <= i; j++) C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
for (int j = 1 + t[i]; j <= i - t[i]; j++) {
g[i] += C[i - 1][j - 1] * g[j - 1] * g[i - j];
}
}
}
Small::solve();
Bigger::solve();
return 0;
}
/*
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 36 17 18 20 19 24 21 23 22 35 25 26 28 27 34 29 30 33 31 32 100 37 39 38 43 40 42 41 51 44 46 45 50 47 49 48 67 52 54 53 58 55 57 56 66 59 61 60 65 62 64 63 99 68 70 69 74 71 73 72 82 77 80 76 81 75 79 78 98 84 87 85 95 89 94 93 97 86 90 88 96 83 92 91
*/
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 8408kb
input:
3 1 2
output:
1 3 2 1 3 2
result:
ok 6 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 7868kb
input:
4 9 13
output:
3 1 4 2 -1
result:
ok 5 number(s): "3 1 4 2 -1"
Test #3:
score: 0
Accepted
time: 2ms
memory: 8244kb
input:
4 20 7
output:
-1 2 3 4 1
result:
ok 5 number(s): "-1 2 3 4 1"
Test #4:
score: 0
Accepted
time: 17ms
memory: 9088kb
input:
99500 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199000 numbers
Test #5:
score: 0
Accepted
time: 13ms
memory: 9576kb
input:
99500 40467622443163494 495971246876580853
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199000 numbers
Test #6:
score: 0
Accepted
time: 13ms
memory: 9196kb
input:
99600 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199200 numbers
Test #7:
score: 0
Accepted
time: 14ms
memory: 9616kb
input:
99600 876080080810139630 528446840542737495
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199200 numbers
Test #8:
score: 0
Accepted
time: 17ms
memory: 9620kb
input:
99700 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199400 numbers
Test #9:
score: 0
Accepted
time: 6ms
memory: 9684kb
input:
99700 711692547767050359 156213023658572307
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199400 numbers
Test #10:
score: 0
Accepted
time: 8ms
memory: 9560kb
input:
99800 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199600 numbers
Test #11:
score: 0
Accepted
time: 13ms
memory: 9620kb
input:
99800 547305006134026495 783979211069374416
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199600 numbers
Test #12:
score: 0
Accepted
time: 11ms
memory: 9164kb
input:
99900 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199800 numbers
Test #13:
score: 0
Accepted
time: 13ms
memory: 9676kb
input:
99900 382917468795969927 188373361625400717
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199800 numbers
Test #14:
score: 0
Accepted
time: 8ms
memory: 9536kb
input:
100000 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 200000 numbers
Test #15:
score: 0
Accepted
time: 13ms
memory: 9628kb
input:
100000 527271021985658374 940151335561648448
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 200000 numbers
Test #16:
score: 0
Accepted
time: 3ms
memory: 8420kb
input:
24999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 49998 numbers
Test #17:
score: 0
Accepted
time: 6ms
memory: 8576kb
input:
24999 136771156689394005 924256336536334059
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 49998 numbers
Test #18:
score: 0
Accepted
time: 3ms
memory: 8868kb
input:
29999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 59998 numbers
Test #19:
score: 0
Accepted
time: 7ms
memory: 8576kb
input:
29999 275583998678440849 312380694035658334
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 59998 numbers
Test #20:
score: 0
Accepted
time: 8ms
memory: 8892kb
input:
34999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 69998 numbers
Test #21:
score: 0
Accepted
time: 8ms
memory: 8808kb
input:
34999 541165311540387602 981345461923895956
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 69998 numbers
Test #22:
score: 0
Accepted
time: 8ms
memory: 8840kb
input:
39999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 79998 numbers
Test #23:
score: 0
Accepted
time: 6ms
memory: 8812kb
input:
39999 903350181794275662 369469819423220230
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 79998 numbers
Test #24:
score: 0
Accepted
time: 9ms
memory: 8816kb
input:
44999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 89998 numbers
Test #25:
score: 0
Accepted
time: 3ms
memory: 8832kb
input:
44999 168931494656222415 261806619871266364
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 89998 numbers
Test #26:
score: 0
Accepted
time: 7ms
memory: 8848kb
input:
49999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 99998 numbers
Test #27:
score: 0
Accepted
time: 10ms
memory: 9040kb
input:
49999 531116369205077770 649930977370590638
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 99998 numbers
Test #28:
score: 0
Accepted
time: 10ms
memory: 9096kb
input:
54999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 109998 numbers
Test #29:
score: 0
Accepted
time: 10ms
memory: 8976kb
input:
54999 796697677772057227 318895740963860964
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 109998 numbers
Test #30:
score: 0
Accepted
time: 7ms
memory: 8752kb
input:
59999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 119998 numbers
Test #31:
score: 0
Accepted
time: 11ms
memory: 8888kb
input:
59999 930392135317961046 514344917370708985
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 119998 numbers
Test #32:
score: 0
Accepted
time: 12ms
memory: 9144kb
input:
64999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 129998 numbers
Test #33:
score: 0
Accepted
time: 8ms
memory: 8924kb
input:
64999 424463865182859336 599356898911231372
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 129998 numbers
Test #34:
score: 0
Accepted
time: 13ms
memory: 9336kb
input:
69999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 139998 numbers
Test #35:
score: 0
Accepted
time: 13ms
memory: 9184kb
input:
69999 563276707171906180 987481256410555646
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 139998 numbers
Test #36:
score: 0
Accepted
time: 13ms
memory: 9048kb
input:
74999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 149998 numbers
Test #37:
score: 0
Accepted
time: 6ms
memory: 9360kb
input:
74999 828858015738885637 879818061153569076
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 149998 numbers
Test #38:
score: 0
Accepted
time: 11ms
memory: 9432kb
input:
79999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 159998 numbers
Test #39:
score: 0
Accepted
time: 14ms
memory: 9408kb
input:
79999 191042890287740993 267942410062958759
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 159998 numbers
Test #40:
score: 0
Accepted
time: 15ms
memory: 9056kb
input:
84999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 169998 numbers
Test #41:
score: 0
Accepted
time: 15ms
memory: 9444kb
input:
84999 456624198854720450 936907177951196380
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 169998 numbers
Test #42:
score: 0
Accepted
time: 13ms
memory: 9024kb
input:
89999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 179998 numbers
Test #43:
score: 0
Accepted
time: 12ms
memory: 9384kb
input:
89999 818809073403575806 325031535450520655
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 179998 numbers
Test #44:
score: 0
Accepted
time: 16ms
memory: 9632kb
input:
94999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 189998 numbers
Test #45:
score: 0
Accepted
time: 17ms
memory: 9464kb
input:
94999 84390386265522559 217368340193534085
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 189998 numbers
Test #46:
score: 0
Accepted
time: 17ms
memory: 9640kb
input:
99999 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199998 numbers
Test #47:
score: 0
Accepted
time: 14ms
memory: 9584kb
input:
99999 223203228254569402 605492693397891063
output:
1 2 4 3 8 5 7 6 16 9 11 10 15 12 14 13 32 17 19 18 23 20 22 21 31 24 26 25 30 27 29 28 64 33 35 34 39 36 38 37 47 40 42 41 46 43 45 44 63 48 50 49 54 51 53 52 62 55 57 56 61 58 60 59 128 65 67 66 71 68 70 69 79 72 74 73 78 75 77 76 95 80 82 81 86 83 85 84 94 87 89 88 93 90 92 91 127 96 98 97 102 99 ...
result:
ok 199998 numbers
Test #48:
score: -100
Wrong Answer
time: 3ms
memory: 8112kb
input:
35 1000000000000000000 1000000000000000000
output:
1 2 4 3 8 5 7 6 23 11 12 10 20 9 15 14 35 18 25 16 30 21 13 27 22 34 29 31 26 19 33 24 28 32 17 31 32 30 33 28 29 27 34 24 25 22 26 3 10 12 35 15 17 18 16 6 21 14 23 4 8 11 19 9 5 20 2 1 13 7
result:
wrong answer 51st numbers differ - expected: '9', found: '35'