QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#292673 | #5567. Balanced Permutations | Radewoosh# | WA | 229ms | 8004kb | C++23 | 5.9kb | 2023-12-28 10:58:05 | 2023-12-28 10:58:05 |
Judging History
answer
//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC target ("avx2")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
*this << "[";
for (auto it = d.b; it != d.e; ++it)
*this << ", " + 2 * (it == d.b) << *it;
ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define shandom_ruffle random_shuffle
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
const int nax=1000*1007;
const int vax=107;
const ll inf=1007LL*1007LL*1007LL*1007LL*1007LL*1007LL;
using mag=__int128;
int n;
int koszt[nax];
pii prz[nax];
ll dp[nax];
ll kom[vax][vax];
int gdzdol[nax];
int gdzgor[nax];
ll mnoz(ll a, ll b)
{
return min(a*(mag)b, (mag)inf);
}
ll pytkom(int a, int b)
{
assert(b>=0 && b<=a);
if (a<vax)
return kom[a][b];
return 1;
}
vi operator +(vi a, vi b)
{
for (int i : b)
a.push_back(i);
return a;
}
vi lift(vi a, int b)
{
for (int &i : a)
i+=b;
return a;
}
void wypisz(vi wek)
{
for (int i : wek)
printf("%d ", i);
printf("\n");
}
ll pasuje(int k, vi per, int m)
{
int r=per.size();
if (m<k)
return 0;
if (!r)
return mnoz(dp[k], kom[m][k]);
ll ret=0;
int g=0;
for (int i=0; i<r; i++)
if (per[i]>per[g])
g=i;
g++;
for (int i=prz[k].first; i<=prz[k].second; i++)
{
ret=min(ret, inf);
if (i<=r)
{
if (i!=g)
continue;
if (per[g-1]<k)
continue;
int ko=0;
for (int a=1; a<i; a++)
{
int naj=0;
for (int b=a; b<i; b++)
{
naj=max(naj, per[b-1]);
if (naj==max(per[a-1], per[b-1]))
ko++;
}
}
if (ko!=koszt[i-1])
continue;
int j=per[g-1];
vi napra(j+1, 1);
napra[0]=napra[j]=0;
for (int l=1; l<i; l++)
napra[per[l-1]]=0;
for (int l=2; l<j; l++)
napra[l]+=napra[l-1];
vi pra;
for (int l=i+1; l<=r; l++)
pra.push_back(napra[per[l-1]]);
//~ ll staret=ret;
ret+=pasuje(k-i, pra, j-1-(i-1));
//~ debug() << imie(k) << " " << imie(m) << " " << i << " " << j << " z " << staret << " na " << ret << " A";
}
else
{
for (int j=max(per[g-1]+1, k); j<=m; j++)
{
//~ ll staret=ret;
ret+=mnoz(mnoz(pasuje(i-1, per, j-1), dp[k-i]), kom[j-1-(i-1)][k-1-(i-1)]);
//~ debug() << imie(k) << " " << imie(m) << " " << i << " " << j << " z " << staret << " na " << ret << " B";
}
}
}
ret=min(ret, inf);
//~ debug() << imie(k) << imie(per) << imie(m) << imie(ret);
return ret;
}
vi solve_smallest(int k, ll kt)
{
if (!k)
return vi{};
if (dp[k]<kt)
return {-1};
if (dp[k-gdzdol[k]]>=kt)
return solve_smallest(gdzdol[k]-1, 1)+vi{k}+lift(solve_smallest(k-gdzdol[k], kt), gdzdol[k]-1);
vi juz(k+1);
vi tab;
for (int i=1; i<=k; i++)
{
for (int j=1; 1; j++)
{
assert(j<=k);
if (juz[j])
continue;
tab.push_back(j);
ll x=pasuje(k, tab, k);
//~ debug() << imie(k) << imie(tab) << imie(x);
//~ exit(0);
if (x<kt)
{
kt-=x;
tab.pop_back();
continue;
}
juz[j]=1;
break;
}
}
return tab;
}
vi solve_largest(int k, ll kt)
{
if (!k)
return vi{};
if (dp[k]<kt)
return {-1};
if (dp[k-gdzgor[k]]>=kt)
return lift(solve_largest(gdzgor[k]-1, 1), k-gdzgor[k])+vi{k}+solve_largest(k-gdzgor[k], kt);
vi juz(k+1);
vi tab;
for (int i=1; i<=k; i++)
{
for (int j=k; 1; j--)
{
assert(j>=1);
if (juz[j])
continue;
tab.push_back(j);
ll x=pasuje(k, tab, k);
if (x<kt)
{
kt-=x;
tab.pop_back();
continue;
}
juz[j]=1;
break;
}
}
return tab;
}
int main()
{
for (int i=0; i<vax; i++)
{
kom[i][0]=1;
for (int j=1; j<=i; j++)
kom[i][j]=min(inf, kom[i-1][j-1]+kom[i-1][j]);
}
scanf("%d", &n);
{
gdzdol[1]=1;
int v=2;
int u=2;
for (int i=1; v<=n; i<<=1)
{
for (int j=0; j<i; j++)
{
gdzdol[v]=u;
v++;
}
for (int j=0; j<i; j++)
{
gdzdol[v]=u;
v++;
u++;
}
}
}
{
//~ gdzgor[1]=1;
int v=1;
int u=1;
for (int i=1; v<=n; i<<=1)
{
for (int j=0; j<i; j++)
{
gdzgor[v]=u;
v++;
}
for (int j=0; j<i; j++)
{
gdzgor[v]=u;
v++;
u++;
}
}
}
dp[0]=1;
for (int i=1; i<=n; i++)
{
koszt[i]=koszt[i/2]+koszt[(i-1)/2]+i;
int bsa=1;
int bsb=i;
while(bsa<bsb)
{
int bss=(bsa+bsb)>>1;
if (koszt[bss-1]+koszt[i-bss]+i==koszt[i])
bsb=bss;
else
bsa=bss+1;
}
prz[i]={bsa, i+1-bsa};
for (int j=prz[i].first; j<=prz[i].second && dp[i]<inf; j++)
dp[i]=min(dp[i]+mnoz(mnoz(dp[j-1], dp[i-j]), pytkom(i-1, j-1)), inf);
}
ll kt;
scanf("%lld", &kt);
wypisz(solve_smallest(n, kt));
scanf("%lld", &kt);
wypisz(solve_largest(n, kt));
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3796kb
input:
3 1 2
output:
1 3 2 1 3 2
result:
ok 6 numbers
Test #2:
score: 0
Accepted
time: 1ms
memory: 3804kb
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: 1ms
memory: 3800kb
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: 20ms
memory: 7748kb
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: 19ms
memory: 7656kb
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: 16ms
memory: 7740kb
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: 28ms
memory: 7728kb
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: 19ms
memory: 7744kb
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: 19ms
memory: 7756kb
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: 17ms
memory: 7664kb
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: 27ms
memory: 7548kb
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: 19ms
memory: 7716kb
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: 27ms
memory: 7752kb
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: 15ms
memory: 7756kb
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: 27ms
memory: 7776kb
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: 7ms
memory: 4748kb
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: 7ms
memory: 4772kb
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: 9ms
memory: 4796kb
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: 9ms
memory: 4940kb
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: 7ms
memory: 5196kb
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: 7ms
memory: 5212kb
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: 12ms
memory: 5408kb
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: 12ms
memory: 5288kb
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: 8ms
memory: 5344kb
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: 13ms
memory: 5464kb
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: 11ms
memory: 5632kb
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: 15ms
memory: 5624kb
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: 7ms
memory: 5676kb
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: 11ms
memory: 5632kb
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: 17ms
memory: 5824kb
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: 13ms
memory: 5992kb
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: 18ms
memory: 6012kb
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: 14ms
memory: 6116kb
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: 15ms
memory: 6900kb
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: 4ms
memory: 6684kb
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: 18ms
memory: 7272kb
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: 14ms
memory: 6980kb
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: 13ms
memory: 7148kb
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: 22ms
memory: 6880kb
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: 24ms
memory: 7128kb
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: 7244kb
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: 25ms
memory: 7516kb
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: 25ms
memory: 7632kb
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: 18ms
memory: 7636kb
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: 22ms
memory: 7664kb
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: 20ms
memory: 8004kb
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: 15ms
memory: 7792kb
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: 229ms
memory: 3812kb
input:
35 1000000000000000000 1000000000000000000
output:
5 1 6 2 3 9 4 8 7 29 14 27 21 28 15 24 19 35 12 25 23 32 17 26 16 11 34 20 30 22 33 18 31 13 10 31 32 30 33 28 29 27 34 24 25 22 26 3 10 12 9 11 35 4 8 15 1 20 6 19 14 23 17 18 5 2 21 7 16 13
result:
wrong answer 1st numbers differ - expected: '1', found: '5'