QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#189153#2705. Mixtape ManagementSayedHassan#AC ✓1ms3568kbC++14921b2023-09-26 21:56:292023-09-26 21:56:30

Judging History

你现在查看的是最新测评结果

  • [2023-09-26 21:56:30]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3568kb
  • [2023-09-26 21:56:29]
  • 提交

answer

#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")


using namespace std;



const int N=100+5;

int a[N],pos[N];
int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        pos[a[i]]=i;
    }
    string v[N];
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<pos[i];j++)
        {
            if(i<a[j])
            {
                while(v[j].size()<=v[pos[i]].size()+1)v[j].push_back('8');
            }


        }
        v[pos[i]].push_back('9');
        for(int j=pos[i]+1;j<n;j++)
        {
            if(i<a[j])
            {
                while(v[j].size()<=v[pos[i]].size())v[j].push_back('9');
            }
        }

    }
    for(int i=0;i<n;i++)cout<<v[i]<<'\n';
    return 0;

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3432kb

input:

1
1

output:

9

result:

ok 

Test #2:

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

input:

2
1 2

output:

9
999

result:

ok 

Test #3:

score: 0
Accepted
time: 0ms
memory: 3500kb

input:

2
2 1

output:

889
9

result:

ok 

Test #4:

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

input:

3
1 2 3

output:

9
999
99999

result:

ok 

Test #5:

score: 0
Accepted
time: 0ms
memory: 3500kb

input:

3
1 3 2

output:

9
99889
999

result:

ok 

Test #6:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

3
2 1 3

output:

889
9
99999

result:

ok 

Test #7:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

3
2 3 1

output:

889
88999
9

result:

ok 

Test #8:

score: 0
Accepted
time: 0ms
memory: 3488kb

input:

3
3 1 2

output:

88889
9
999

result:

ok 

Test #9:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

3
3 2 1

output:

88889
889
9

result:

ok 

Test #10:

score: 0
Accepted
time: 0ms
memory: 3436kb

input:

7
4 2 6 1 5 7 3

output:

8888889
889
88998899889
9
999988999
9999889999999
99999

result:

ok 

Test #11:

score: 0
Accepted
time: 0ms
memory: 3432kb

input:

13
1 2 3 4 5 6 7 8 9 10 11 12 13

output:

9
999
99999
9999999
999999999
99999999999
9999999999999
999999999999999
99999999999999999
9999999999999999999
999999999999999999999
99999999999999999999999
9999999999999999999999999

result:

ok 

Test #12:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

97
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 89 90 91 92 93 94 95 96 97

output:

9
999
99999
9999999
999999999
99999999999
9999999999999
999999999999999
99999999999999999
9999999999999999999
999999999999999999999
99999999999999999999999
9999999999999999999999999
999999999999999999999999999
99999999999999999999999999999
9999999999999999999999999999999
9999999999999999999999999999...

result:

ok 

Test #13:

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

input:

100
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 89 90 91 92 93 94 95 96 97 98 99 100

output:

9
999
99999
9999999
999999999
99999999999
9999999999999
999999999999999
99999999999999999
9999999999999999999
999999999999999999999
99999999999999999999999
9999999999999999999999999
999999999999999999999999999
99999999999999999999999999999
9999999999999999999999999999999
9999999999999999999999999999...

result:

ok 

Test #14:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

10
10 9 8 7 6 5 4 3 2 1

output:

8888888888888888889
88888888888888889
888888888888889
8888888888889
88888888889
888888889
8888889
88889
889
9

result:

ok 

Test #15:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

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

output:

88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok 

Test #16:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

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

output:

8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok 

Test #17:

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

input:

15
9 11 1 4 7 13 12 2 10 5 15 14 6 8 3

output:

88888888888888889
888888888888888899889
9
9988889
9988889988889
9988889988889988998899889
99888899888899889988999
999
9999889988889988999
999988999
99998899998899889999999999889
999988999988998899999999999
99998899999
999988999999999
99999

result:

ok 

Test #18:

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

input:

38
4 12 9 7 18 35 31 17 21 8 20 13 28 32 19 11 34 36 33 15 5 16 22 27 37 23 2 3 1 25 10 6 26 14 38 29 24 30

output:

8888889
88888899888888888888889
88888899888888889
8888889988889
88888899888899889988889988888888889
888888998888998899888899888888888899888888888888888888888888888888889
8888889988889988998888998888888888998888888888888888888888889
888888998888998899888899888888889
8888889988889988998888998888888899...

result:

ok 

Test #19:

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

input:

67
33 53 54 42 30 9 21 27 36 58 39 48 43 66 13 28 14 37 47 67 5 11 19 18 32 57 31 17 55 64 60 29 24 3 44 4 12 7 40 10 25 8 59 2 52 49 61 51 46 45 50 41 22 38 16 1 6 65 56 62 23 35 63 34 26 20 15

output:

88888888888888888888888888888888888888888888888888888888888888889
888888888888888888888888888888888888888888888888888888888888888899888888888888888888888888888888888888889
88888888888888888888888888888888888888888888888888888888888888889988888888888888888888888888888888888888999
88888888888888888888...

result:

ok 

Test #20:

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

input:

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

output:

8888888888888888888888888888888888888888888888888888888888888888888888889
8888888888889
8888888888889988888888888888889
888888888888998888888888888888998888888888888888888888888888888888888888998888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
88888888...

result:

ok 

Test #21:

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

input:

4
4 1 3 2

output:

8888889
9
99889
999

result:

ok 

Test #22:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

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

output:

8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888998888888888888888888888888888888888889
888888888888888888888888888888888888888888...

result:

ok 

Test #23:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

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

output:

8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
8888888888888888888888888888888888888888888888888888888888888888888888888888888888889
88888888888888...

result:

ok 

Test #24:

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

input:

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

output:

8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
88888888888888888888888888...

result:

ok 

Test #25:

score: 0
Accepted
time: 0ms
memory: 3484kb

input:

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

output:

88888888888888888888888888888888888888888888888888888888888888889
88888888888888888888888888888888888888889
88888888888888888888888888888888888888889988888888888888888888889988888888888888888888888888888888888888888888888888888888888888889
888888888888888888889
88888888888888888888998888888888888888...

result:

ok 

Test #26:

score: 0
Accepted
time: 0ms
memory: 3432kb

input:

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

output:

8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok 

Test #27:

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

input:

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

output:

88888888888888889
9
998888888888889
99888888889
9988888888999
99889
999
999999888899999999888888889
99999988889999999988888888999
9999998888999999999
99999988889999999999889
9999999
999999998899999999999
999999999
9999999999999999999999999
999999999999999999999999999999888888889
99999999999999999999...

result:

ok 

Test #28:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

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

output:

888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok 

Test #29:

score: 0
Accepted
time: 0ms
memory: 3484kb

input:

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

output:

8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok 

Test #30:

score: 0
Accepted
time: 0ms
memory: 3468kb

input:

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

output:

8888889
88889
8888999988889
888899998888999
9
998899998888999988889
99889999889
999
99999999889999999
9999999988999999998899889
99999999889999999988999
999999999
9999999999999999999
99999999999999999999999999889
999999999999999999999999999
9999999999999999999999999999999
9999999999999999999999999999...

result:

ok 

Test #31:

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

input:

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

output:

88888888888888888888888888888888888888888888888888888888888888888888888888888888889
888888888888888888888888888888888888888888888888888888888888888888888888888888888899888888888888888888888888888888888888888888888888888888888888888888888888888888889
88888888888888888888888888888888888888888888888888...

result:

ok 

Test #32:

score: 0
Accepted
time: 0ms
memory: 3492kb

input:

100
87 81 97 89 72 67 75 62 91 84 83 88 66 61 78 86 70 63 96 71 85 94 82 73 65 76 90 92 64 99 95 100 80 69 74 93 68 98 79 77 50 51 52 53 54 55 56 57 58 59 60 49 48 47 46 45 44 43 42 41 40 39 38 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

output:

88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok 

Test #33:

score: 0
Accepted
time: 0ms
memory: 3472kb

input:

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

output:

888888888888889
88888888889
9
9988888888998899888888888888888888889
99888888889988998888888888889
9988888888999
998888888899999988888888888899889
998888888899999988889
9988888888999999888899889
9988889
9988889988999999888899889988999
99888899889999998888999
9988889988999999889
99888899889999999
9988...

result:

ok 

Test #34:

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

input:

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

output:

8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok 

Test #35:

score: 0
Accepted
time: 0ms
memory: 3460kb

input:

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

output:

8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888889
8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok 

Test #36:

score: 0
Accepted
time: 0ms
memory: 3472kb

input:

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

output:

9
999
99999
99999988889
999999889
9999999
999999999999889
9999999999999
99999999999999999
99999999999999999988889
999999999999999999889
9999999999999999999
999999999999999999999999889
9999999999999999999999998899889
99999999999999999999999988999
9999999999999999999999999
9999999999999999999999999999...

result:

ok 

Test #37:

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

input:

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

output:

888888888888888888888888888888888888888888888888888888888888888888888888888888889
8888888888888888888888888888888888888888888888888888888888888888888888888888888899888888888888888888888888888888888888888888888888888888888888889
888888888888888888888888888888888888888888888888888888888888888888888888...

result:

ok