QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#945687#10182. 진화 2fansizhe100 ✓8ms8168kbC++201.3kb2025-03-21 07:50:312025-03-21 07:50:32

Judging History

This is the latest submission verdict.

  • [2025-03-21 07:50:32]
  • Judged
  • Verdict: 100
  • Time: 8ms
  • Memory: 8168kb
  • [2025-03-21 07:50:31]
  • Submitted

answer

#include"evolution2.h"
#include<bits/stdc++.h>
using namespace std;
namespace{
    int n;
    int fa[10005];
    vector<int> edge[10005];
    int ans[10005];
    bool cmp(int x,int y){return compare(x-1,y-1);}
    vector<int> vec[10005];
    void merge(vector<int> &y,vector<int> &x){
        if(x.size()>y.size())swap(x,y);
        if(x.empty())return;
        int len=round(1.0*y.size()/x.size());
        int lst=-1,sx=x.size();
        for(int i:x){
            int k=0;
            while((sx<<k+1)<=y.size()-1-lst)k++;
            while(lst+(1<<k)<y.size()&&cmp(i,y[lst+(1<<k)]))lst+=1<<k;
            while(k--)if(lst+(1<<k)<y.size()&&cmp(i,y[lst+(1<<k)]))lst+=1<<k;
            lst++;
            y.insert(y.begin()+lst,i);
            sx--;
        }
        x.clear();
    }
    void dfs(int x){
        for(int y:edge[x]){
            dfs(y);
            merge(vec[x],vec[y]);
        }
        vec[x].push_back(x);
    }
}
vector<int> recover(int N,vector<int> U,vector<int> V){
    n=N;
    for(int i=1;i<=n;i++)edge[i].clear(),vec[i].clear();
    for(int i=0;i<N-1;i++)fa[V[i]+1]=U[i]+1,edge[U[i]+1].push_back(V[i]+1);
    dfs(1);
    for(int i=0;i<n;i++)ans[vec[1][i]]=n-i;
    vector<int> res;
    for(int i=1;i<=n;i++)res.push_back(ans[i]-1);
    return res;
}

詳細信息

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 6ms
memory: 7960kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #2:

score: 1
Accepted
time: 1ms
memory: 4284kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
1000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 8...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #3:

score: 1
Accepted
time: 1ms
memory: 3928kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
100
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #4:

score: 1
Accepted
time: 0ms
memory: 3900kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
2
0
0 1

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #5:

score: 1
Accepted
time: 2ms
memory: 3920kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
100
88
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
0 24...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Subtask #2:

score: 7
Accepted

Test #6:

score: 7
Accepted
time: 6ms
memory: 6124kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #7:

score: 7
Accepted
time: 6ms
memory: 6216kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #8:

score: 7
Accepted
time: 0ms
memory: 3816kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
2
0
0 1

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #9:

score: 7
Accepted
time: 2ms
memory: 4144kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
100
88
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 24 70 4 18 74 32 40 23 21 39 87 10 66 85 34 14 51 82 67 42 3 11 6 58 5 25 13 17...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Subtask #3:

score: 12
Accepted

Test #10:

score: 12
Accepted
time: 6ms
memory: 6304kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
8191
0 1 0 3 1 3 5 4 4 8 8 9 10 12 5 14 15 15 9 6 2 17 14 22 6 19 21 27 24 25 26 31 28 7 33 13 25 30 2 11 20 19 39 34 30 29 16 38 21 38 37 22 40 10 7 50 41 39 17 37 40 27 49 58 44 58 20 63 59 42 55 12 34 71 63 74 18 56 60 66 66 64 43 69 57 42 67 81 48 67 65 18...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #11:

score: 12
Accepted
time: 1ms
memory: 4148kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
255
0 0 1 2 4 1 6 5 4 2 3 10 5 11 7 10 6 11 14 9 17 3 13 21 16 9 21 8 24 22 25 30 20 14 27 12 34 30 37 26 12 22 36 36 7 13 42 41 32 20 16 41 38 51 18 15 32 28 44 45 55 34 17 42 18 56 65 63 51 69 68 33 23 27 69 29 47 25 59 55 28 78 53 67 33 38 23 8 44 56 26 75 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #12:

score: 12
Accepted
time: 0ms
memory: 3884kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
3
0 0
0 1 2

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #13:

score: 12
Accepted
time: 1ms
memory: 4092kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
100
31
0 0 2 1 1 3 4 5 2 4 6 9 9 10 3 12 12 8 10 5 15 13 13 7 8 20 20 6 7 15
0 21 29 16 28 26 25 27 11 20 14 17 7 23 4 2 12 22 18 1 5 6 3 13 15 24 8 30 9 10 19
63
0 0 2 1 1 4 5 4 5 9 6 8 3 11 7 7 8 13 2 16 12 13 12 19 24 19 24 9 27 10 3 31 26 6 10 34 22 15 34 15...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Subtask #4:

score: 80
Accepted

Test #14:

score: 80
Accepted
time: 5ms
memory: 8060kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #15:

score: 80
Accepted
time: 6ms
memory: 7880kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 0 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 21 23 24 25 26 22 27 29 30 31 32 33 34 35 36 28 38 39 37 41 42 43 40 44 46 47 48 49 45 50 52 53 54 55 51 56 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 8...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #16:

score: 80
Accepted
time: 6ms
memory: 7384kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 0 4 5 6 8 7 9 10 11 12 13 15 16 17 14 18 19 21 20 23 24 22 26 27 25 29 30 28 31 33 32 34 36 37 35 39 38 41 40 42 43 44 46 45 47 49 48 50 52 51 53 55 54 57 58 59 56 60 61 62 64 63 66 65 67 68 69 71 70 72 74 75 76 73 77 79 78 81 80 83 82 84 86 85 8...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #17:

score: 80
Accepted
time: 0ms
memory: 8088kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 7 8 9 10 0 11 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 8...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #18:

score: 80
Accepted
time: 5ms
memory: 8168kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 0 19 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 20 79 81 82 83 84 85 86 87 8...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #19:

score: 80
Accepted
time: 5ms
memory: 8076kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 7 8 0 9 11 12 13 14 10 15 17 18 19 16 20 22 23 21 24 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 8...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #20:

score: 80
Accepted
time: 8ms
memory: 6404kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 0 2 4 2 4 2 8 7 3 8 10 4 13 7 15 2 3 18 6 9 15 7 14 7 25 13 9 17 2 15 20 11 16 10 19 22 37 3 30 38 37 30 30 21 20 24 4 12 11 42 8 17 27 20 0 18 46 39 11 18 37 59 19 58 62 26 0 65 6 67 0 43 4 52 10 9 39 32 37 25 1 58 7 60 33 0 37 14 56 12 61 59 9 15 3...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #21:

score: 80
Accepted
time: 1ms
memory: 4240kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
1000
0 0 0 3 1 2 4 0 6 5 5 11 10 7 5 1 14 17 16 5 20 13 13 2 20 19 0 22 0 2 30 18 25 12 31 23 30 28 22 3 9 15 23 26 27 32 18 38 38 45 39 27 8 6 52 27 12 25 40 51 50 11 59 4 36 6 38 36 20 23 17 66 41 26 41 69 30 7 16 70 57 35 38 37 34 77 33 1 17 66 46 57 10 90 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #22:

score: 80
Accepted
time: 1ms
memory: 3908kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
100
0 1 0 0 2 5 4 4 3 7 3 3 2 13 9 13 7 12 11 17 7 2 6 0 11 9 8 16 25 29 20 10 28 18 19 24 16 9 8 25 5 39 41 28 1 23 13 24 5 40 46 23 20 45 27 7 29 1 18 40 53 42 22 0 64 20 18 34 57 7 70 58 11 1 12 3 15 6 21 57 25 43 0 11 13 79 18 11 42 76 20 53 40 93 36 60 27...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #23:

score: 80
Accepted
time: 6ms
memory: 7788kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 0 7 9 10 11 12 13 14 15 16 17 18 8 19 20 22 21 23 24 26 27 28 25 29 31 30 33 34 32 36 37 35 38 39 40 41 43 42 45 44 46 48 49 50 51 52 47 53 55 56 57 58 59 60 54 61 62 63 64 66 67 65 69 68 70 72 73 74 75 76 71 77 79 80 81 82 83 84 78 86 85 8...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #24:

score: 80
Accepted
time: 0ms
memory: 4100kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
11
0 0 2 1 4 5 6 7 8 9
0 9 1 5 6 2 4 7 3 8 10

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #25:

score: 80
Accepted
time: 0ms
memory: 3924kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
21
0 1 2 3 4 0 5 7 6 8 10 9 11 12 13 15 16 17 18 19
0 5 20 11 13 2 10 4 18 17 14 8 3 9 19 7 1 16 12 6 15

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #26:

score: 80
Accepted
time: 0ms
memory: 4028kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
32
0 0 2 3 1 4 6 7 5 8 9 10 11 12 14 13 16 15 18 19 20 21 22 23 24 25 26 27 17 28 30
0 15 12 25 11 18 16 14 6 7 2 19 23 20 5 9 29 28 21 30 1 17 31 8 4 3 27 22 13 24 26 10

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #27:

score: 80
Accepted
time: 0ms
memory: 3964kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
8
0 0 1 3 4 2 5
0 5 3 4 6 7 2 1

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #28:

score: 80
Accepted
time: 0ms
memory: 3936kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
3
0 0
0 2 1

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #29:

score: 80
Accepted
time: 3ms
memory: 4176kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
368
3
0 0
0 2 1
4
0 0 1
0 2 1 3
5
0 0 1 3
0 4 1 3 2
5
0 1 0 3
0 1 4 3 2
6
0 1 0 2 4
0 5 3 4 2 1
6
0 0 1 2 4
0 4 2 1 3 5
7
0 1 2 3 0 4
0 5 3 2 6 1 4
7
0 0 1 3 4 2
0 2 1 4 5 3 6
7
0 0 1 2 3 4
0 5 6 1 2 3 4
8
0 1 2 0 3 5 6
0 7 5 4 3 2 1 6
8
0 0 1 3 4 5 2
0 6 4 1 2 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #30:

score: 80
Accepted
time: 3ms
memory: 4032kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
368
3
0 0
0 1 2
4
0 1 0
0 1 2 3
5
0 1 2 0
0 1 2 3 4
5
0 1 0 3
0 1 2 3 4
6
0 1 2 3 0
0 1 2 3 4 5
6
0 1 2 0 4
0 1 2 3 4 5
7
0 1 2 3 4 0
0 1 2 3 4 5 6
7
0 1 2 3 0 5
0 1 2 3 4 5 6
7
0 1 2 0 4 5
0 1 2 3 4 5 6
8
0 1 2 3 4 5 0
0 1 2 3 4 5 6 7
8
0 1 2 3 4 0 6
0 1 2 3 4 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #31:

score: 80
Accepted
time: 0ms
memory: 7996kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #32:

score: 80
Accepted
time: 0ms
memory: 8048kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #33:

score: 80
Accepted
time: 5ms
memory: 8016kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #34:

score: 80
Accepted
time: 5ms
memory: 7984kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #35:

score: 80
Accepted
time: 5ms
memory: 7896kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #36:

score: 80
Accepted
time: 2ms
memory: 7932kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
10000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #37:

score: 80
Accepted
time: 0ms
memory: 5416kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
24
21
0 1 1 2 4 3 5 7 8 9 10 11 12 13 14 15 16 6 17 19
0 11 15 10 9 8 14 12 6 19 3 13 16 2 20 5 7 4 1 18 17
85
0 1 2 1 3 5 6 4 7 9 10 11 12 13 14 15 16 17 8 18 19 0 22 23 22 24 26 27 25 28 30 31 32 33 34 35 36 37 38 29 39 40 0 43 44 43 45 47 48 46 49 51 52 53 54...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #38:

score: 80
Accepted
time: 2ms
memory: 5068kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
2
3158
0 1 1 2 4 5 6 7 8 9 10 3 11 13 14 15 16 17 12 18 19 20 21 22 24 25 26 23 27 29 30 31 32 33 28 35 34 37 38 39 36 40 42 43 44 45 46 47 41 48 49 50 52 53 54 55 51 56 58 59 60 61 62 63 64 65 66 67 68 69 57 70 72 73 74 71 75 77 78 79 80 81 82 83 84 85 86 87 88...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #39:

score: 80
Accepted
time: 0ms
memory: 4048kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
240
0 1 2 3 0 4 6 7 8 5 10 9 12 13 14 11 15 17 18 19 16 21 20 23 24 25 22 26 28 29 30 27 32 31 34 35 36 33 37 39 40 41 38 43 42 45 46 47 44 48 50 51 52 49 54 53 56 57 58 55 59 61 62 63 60 65 64 67 68 69 66 70 72 73 74 71 76 75 78 79 80 77 81 83 84 85 82 87 86 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #40:

score: 80
Accepted
time: 1ms
memory: 4124kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
484
0 1 0 2 4 3 6 5 8 9 10 11 12 13 14 7 15 17 18 19 20 21 22 23 16 25 24 27 28 29 26 30 32 33 34 31 36 35 38 39 40 37 41 43 44 45 42 47 46 49 50 51 48 52 54 55 56 53 58 57 60 61 62 59 63 65 66 67 64 69 68 71 72 73 70 74 76 77 78 75 80 79 82 83 84 81 85 87 88 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #41:

score: 80
Accepted
time: 1ms
memory: 4396kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
1001
0 0 2 3 4 1 5 7 8 9 6 11 10 13 14 15 12 16 18 19 20 17 22 21 24 25 26 23 27 29 30 31 28 33 32 35 36 37 34 38 40 41 42 39 44 43 46 47 48 45 49 51 52 53 50 55 54 57 58 59 56 60 62 63 64 61 66 65 68 69 70 67 71 73 74 75 72 77 76 79 80 81 78 82 84 85 86 83 88...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #42:

score: 80
Accepted
time: 1ms
memory: 4208kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
484
0 1 2 3 4 5 6 7 0 8 10 11 12 13 14 15 16 9 18 17 20 21 22 23 24 25 26 19 27 29 30 31 32 33 34 35 28 37 36 39 40 41 42 43 44 45 38 46 48 49 50 51 52 53 54 47 56 55 58 59 60 61 62 63 64 57 65 67 68 69 70 71 72 73 66 75 74 77 78 79 80 81 82 83 76 84 86 87 88 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #43:

score: 80
Accepted
time: 1ms
memory: 4220kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
496
0 0 1 3 4 2 5 6 7 8 9 10 11 13 14 12 15 16 17 18 19 21 22 20 23 24 25 26 27 29 30 28 32 31 33 34 36 37 35 38 39 40 41 42 43 44 46 47 45 49 48 50 51 53 54 52 55 56 57 58 59 61 62 60 64 63 65 66 68 69 67 70 71 72 73 74 75 76 78 79 77 81 80 82 83 85 86 84 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #44:

score: 80
Accepted
time: 1ms
memory: 4156kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
496
0 1 0 3 4 2 5 6 7 9 10 8 11 12 14 13 16 17 15 18 19 20 21 22 24 25 23 26 27 29 28 31 32 30 33 34 35 36 37 39 40 38 41 42 44 43 46 47 45 48 49 50 51 52 53 54 56 57 55 58 59 61 62 60 64 65 63 66 67 68 70 71 69 72 73 75 74 77 78 76 79 80 81 82 83 85 86 84 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #45:

score: 80
Accepted
time: 1ms
memory: 4172kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
401
0 0 2 3 1 4 6 7 5 8 10 11 12 13 9 14 16 17 18 19 15 20 22 23 24 25 21 26 28 29 27 30 32 33 31 34 36 37 38 39 35 40 42 43 44 45 41 46 48 49 50 51 47 52 54 55 53 56 58 59 57 60 62 63 64 65 61 66 68 69 70 71 67 72 74 75 76 77 73 78 80 81 82 83 79 84 86 87 88 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #46:

score: 80
Accepted
time: 1ms
memory: 4088kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
401
0 1 2 3 4 5 6 7 8 0 9 11 12 13 14 10 15 17 18 19 20 16 21 23 24 25 26 22 27 29 30 31 32 28 33 35 36 37 38 34 39 41 42 40 43 45 46 44 47 49 50 51 52 48 53 55 56 57 58 54 59 61 62 63 64 60 65 67 68 69 70 66 71 73 74 75 76 72 77 79 80 81 82 78 83 85 86 87 88 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #47:

score: 80
Accepted
time: 0ms
memory: 4076kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
7
0 1 2 3 0 5
0 1 2 3 4 5 6

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #48:

score: 80
Accepted
time: 0ms
memory: 4040kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
7
0 1 0 3 4 5
0 1 2 3 4 5 6

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #49:

score: 80
Accepted
time: 1ms
memory: 4236kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
466
0 1 0 3 4 5 6 2 8 7 10 11 12 13 9 15 14 17 18 19 20 16 22 21 24 25 26 27 23 29 28 31 32 33 34 30 36 35 38 39 40 41 37 43 42 45 46 47 48 44 50 49 52 53 51 54 56 55 58 57 60 61 62 63 59 65 64 67 68 69 70 66 72 71 74 75 76 77 73 79 78 81 82 80 83 85 84 87 86 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #50:

score: 80
Accepted
time: 1ms
memory: 4224kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
466
0 1 2 3 0 5 4 7 8 9 10 6 12 13 14 11 16 15 17 19 20 18 22 21 24 25 26 27 23 29 28 31 30 32 34 35 33 37 36 39 40 41 42 38 44 43 46 47 48 49 45 51 50 53 54 55 56 52 58 57 60 61 62 63 59 65 64 67 68 69 70 66 72 71 74 75 76 77 73 79 78 81 82 83 84 80 86 87 88 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #51:

score: 80
Accepted
time: 1ms
memory: 4204kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
467
0 1 2 3 4 5 6 0 7 9 10 8 11 12 13 14 15 16 17 18 19 21 22 20 23 24 25 26 27 29 30 28 31 33 34 35 32 36 37 38 39 40 41 42 44 45 43 46 47 48 50 51 49 52 53 54 55 56 58 59 57 60 61 62 64 65 66 67 68 69 63 71 70 72 73 75 76 74 77 78 79 81 82 80 83 84 85 86 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #52:

score: 80
Accepted
time: 1ms
memory: 4132kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
467
0 1 2 0 3 4 5 7 8 6 9 10 11 13 14 12 15 16 17 18 19 21 22 20 23 24 25 27 28 26 29 30 31 32 33 35 36 34 37 38 39 41 42 40 43 44 45 46 47 48 49 51 52 53 50 54 56 57 55 58 59 60 61 62 64 65 63 66 67 68 70 71 69 72 73 74 75 76 77 78 80 81 82 79 83 85 86 84 87 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #53:

score: 80
Accepted
time: 1ms
memory: 4132kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
401
0 0 2 3 1 4 6 7 5 8 10 11 12 13 9 14 16 17 18 19 15 20 22 23 24 25 21 26 28 29 27 30 32 33 31 34 36 37 38 39 35 40 42 43 44 45 41 46 48 49 50 51 47 52 54 55 53 56 58 59 57 60 62 63 64 65 61 66 68 69 70 71 67 72 74 75 76 77 73 78 80 81 82 83 79 84 86 87 88 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #54:

score: 80
Accepted
time: 1ms
memory: 4244kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
401
0 1 2 3 4 5 6 7 8 0 9 11 12 13 14 10 15 17 18 19 20 16 21 23 24 25 26 22 27 29 30 31 32 28 33 35 36 37 38 34 39 41 42 40 43 45 46 44 47 49 50 51 52 48 53 55 56 57 58 54 59 61 62 63 64 60 65 67 68 69 70 66 71 73 74 75 76 72 77 79 80 81 82 78 83 85 86 87 88 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #55:

score: 80
Accepted
time: 1ms
memory: 4252kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
367
0 1 2 3 4 5 6 7 0 9 10 8 12 13 14 15 16 17 18 11 20 21 19 23 24 25 26 27 28 29 22 31 32 30 34 35 36 37 38 39 40 41 33 43 44 42 46 47 48 49 50 51 52 45 54 55 53 57 58 59 60 61 62 63 64 56 66 67 65 69 70 71 72 73 74 75 68 77 78 76 80 81 82 83 84 85 86 87 79 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #56:

score: 80
Accepted
time: 1ms
memory: 4168kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
367
0 1 0 3 4 5 6 7 8 9 10 11 2 13 14 12 16 17 18 19 20 21 22 15 24 25 23 27 28 29 30 31 32 33 34 26 36 37 35 39 40 41 42 43 44 45 38 47 48 46 50 51 52 53 54 55 56 57 49 59 60 58 62 63 64 65 66 67 68 61 70 71 69 73 74 75 76 77 78 79 72 81 82 80 84 85 86 87 88 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #57:

score: 80
Accepted
time: 0ms
memory: 4156kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
466
0 1 0 3 4 5 6 2 8 7 10 11 12 13 9 15 14 17 18 19 20 16 22 21 24 25 26 27 23 29 28 31 32 33 34 30 36 35 38 39 40 41 37 43 42 45 46 47 48 44 50 49 52 53 51 54 56 55 58 57 60 61 62 63 59 65 64 67 68 69 70 66 72 71 74 75 76 77 73 79 78 81 82 80 83 85 84 87 86 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #58:

score: 80
Accepted
time: 1ms
memory: 4160kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
1
466
0 1 2 3 0 5 4 7 8 9 10 6 12 13 14 11 16 15 17 19 20 18 22 21 24 25 26 27 23 29 28 31 30 32 34 35 33 37 36 39 40 41 42 38 44 43 46 47 48 49 45 51 50 53 54 55 56 52 58 57 60 61 62 63 59 65 64 67 68 69 70 66 72 71 74 75 76 77 73 79 78 81 82 83 84 80 86 87 88 ...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #59:

score: 80
Accepted
time: 3ms
memory: 4204kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
22
249
0 0 1 3 4 2 5 6 7 8 9 10 11 13 14 12 15 16 17 18 19 21 22 20 23 24 25 26 27 29 30 28 32 31 33 34 36 37 35 38 39 40 41 42 43 44 46 47 45 49 48 50 51 53 54 52 55 56 57 58 59 61 62 60 64 63 65 66 68 69 67 70 71 72 73 74 75 76 78 79 77 81 80 82 83 85 86 84 87...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #60:

score: 80
Accepted
time: 3ms
memory: 4324kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
22
249
0 1 0 3 4 2 5 6 7 9 10 8 11 12 14 13 16 17 15 18 19 20 21 22 24 25 23 26 27 29 28 31 32 30 33 34 35 36 37 39 40 38 41 42 44 43 46 47 45 48 49 50 51 52 53 54 56 57 55 58 59 61 62 60 64 65 63 66 67 68 70 71 69 72 73 75 74 77 78 76 79 80 81 82 83 85 86 84 87...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #61:

score: 80
Accepted
time: 3ms
memory: 4112kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
64
50
0 0 2 3 1 4 6 7 5 8 10 11 12 13 9 14 16 17 18 19 15 20 22 23 24 25 21 26 28 29 30 31 27 32 34 35 36 37 33 38 40 41 42 43 39 44 46 47 48
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 4...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #62:

score: 80
Accepted
time: 3ms
memory: 4224kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
64
50
0 1 2 3 0 4 6 7 8 9 5 10 12 13 14 15 11 16 18 19 20 21 17 22 24 25 26 27 23 28 30 31 32 33 29 34 36 37 38 39 35 40 42 43 41 44 46 47 45
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 4...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #63:

score: 80
Accepted
time: 3ms
memory: 4200kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
172
7
0 1 2 3 0 5
0 1 2 3 4 5 6
10
0 1 2 3 0 5 6 4 7
0 1 2 3 4 5 6 7 8 9
12
0 1 2 3 0 5 6 4 8 7 10
0 1 2 3 4 5 6 7 8 9 10 11
15
0 1 2 3 0 5 6 4 8 9 10 11 7 13
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
20
0 1 2 3 0 5 6 4 8 7 10 9 12 13 14 11 16 17 18
0 1 2 3 4 5 6 7 8 9...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #64:

score: 80
Accepted
time: 3ms
memory: 4132kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
172
7
0 1 0 3 4 5
0 1 2 3 4 5 6
10
0 0 1 3 4 2 6 7 8
0 1 2 3 4 5 6 7 8 9
12
0 1 0 3 2 5 6 4 8 9 10
0 1 2 3 4 5 6 7 8 9 10 11
15
0 1 0 3 4 5 6 2 8 9 7 11 12 13
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
20
0 1 2 3 0 5 6 7 4 9 8 11 10 13 14 12 16 17 18
0 1 2 3 4 5 6 7 8 9...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #65:

score: 80
Accepted
time: 3ms
memory: 4208kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
197
7
0 1 0 3 4 5
0 1 2 3 4 5 6
10
0 1 0 3 4 2 6 5 8
0 1 2 3 4 5 6 7 8 9
15
0 1 0 3 4 5 6 2 8 7 10 11 9 12
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
17
0 1 0 3 4 2 6 5 8 9 7 11 10 13 14 15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
20
0 1 0 3 4 2 6 5 8 9 7 11 12 13 10 15...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct

Test #66:

score: 80
Accepted
time: 3ms
memory: 4120kb

input:

a21b0d6d-585f-INPUT-93fe-7202aef2815b
197
7
0 1 2 3 0 5
0 1 2 3 4 5 6
10
0 1 0 3 2 5 6 4 8
0 1 2 3 4 5 6 7 8 9
15
0 0 1 3 4 2 6 5 8 9 10 11 7 13
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
17
0 1 2 3 0 5 4 7 8 6 10 9 12 13 11 15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
20
0 0 1 3 4 2 6 7 8 5 10 11 9 13 12 15...

output:

00daad08-86ae-OUTPUT-b142-47d36a7488d9
100

result:

ok Correct