QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#287334#4205. Art CollectionsMax_s_xaM100 ✓1471ms4112kbC++142.6kb2023-12-20 11:54:442023-12-20 11:54:44

Judging History

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

  • [2023-12-20 11:54:44]
  • 评测
  • 测评结果:100
  • 用时:1471ms
  • 内存:4112kb
  • [2023-12-20 11:54:44]
  • 提交

answer

#include "art.h"

#include <iostream>
#include <algorithm>
#include <vector>

typedef long long ll;
typedef double lf;

// #define DEBUG 1
struct IO
{
    #define MAXSIZE (1 << 20)
    #define isdigit(x) (x >= '0' && x <= '9')
    char buf[MAXSIZE], *p1, *p2;
    char pbuf[MAXSIZE], *pp;
    #if DEBUG
    #else
    IO() : p1(buf), p2(buf), pp(pbuf) {}
    ~IO() {fwrite(pbuf, 1, pp - pbuf, stdout);}
    #endif
    #define gc() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin), p1 == p2) ? ' ' : *p1++)
    #define blank(x) (x == ' ' || x == '\n' || x == '\r' || x == '\t')

    template <typename T>
    void Read(T &x)
    {
        #if DEBUG
        std::cin >> x;
        #else
        bool sign = 0; char ch = gc(); x = 0;
        for (; !isdigit(ch); ch = gc())
            if (ch == '-') sign = 1;
        for (; isdigit(ch); ch = gc()) x = x * 10 + (ch ^ 48);
        if (sign) x = -x;
        #endif
    }
    void Read(char *s)
    {
        #if DEBUG
        std::cin >> s;
        #else
        char ch = gc();
        for (; blank(ch); ch = gc());
        for (; !blank(ch); ch = gc()) *s++ = ch;
        *s = 0;
        #endif
    }
    void Read(char &c) {for (c = gc(); blank(c); c = gc());}

    void Push(const char &c)
    {
        #if DEBUG
        putchar(c);
        #else
        if (pp - pbuf == MAXSIZE) fwrite(pbuf, 1, MAXSIZE, stdout), pp = pbuf;
        *pp++ = c;
        #endif
    }
    template <typename T>
    void Write(T x)
    {
        if (x < 0) x = -x, Push('-');
        static T sta[35];
        int top = 0;
        do sta[top++] = x % 10, x /= 10; while (x);
        while (top) Push(sta[--top] ^ 48);
    }
    template <typename T>
    void Write(T x, char lst) {Write(x), Push(lst);}
} IO;
#define Read(x) IO.Read(x)
#define Write(x, y) IO.Write(x, y)
#define Put(x) IO.Push(x)

using namespace std;

const int MAXN = 4e3 + 10;

int n;
vector <int> a, b;

void solve(int N)
{
    n = N;
    // cerr << n << "\n";
    a.resize(n), b.resize(n);
    for (int i = 1; i <= n; i++) a[i - 1] = i;
    int t = publish(a);
    // cerr << t << "\n";
    for (int i = 2; i <= n; i++)
    {
        // if (i % 100 == 0) cerr << i << "\n";
        b[0] = a[i - 1];
        for (int j = 0; j < i - 1; j++) b[j + 1] = a[j];
        for (int j = i; j < n; j++) b[j] = a[j];
        int newt = publish(b);
        int rk = (newt - t + i - 1) / 2;
        t = newt - rk;
        for (int j = 1; j <= rk; j++) a[j - 1] = b[j];
        a[rk] = b[0];
        for (int j = rk + 1; j < n; j++) a[j] = b[j];
    }
    // cerr << "O\n";
    answer(a);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 4024kb

input:

6
15
14
12
9
5
0

output:

942318468 6 1 2 3 4 5 6
942318468 6 2 1 3 4 5 6
942318468 6 3 2 1 4 5 6
942318468 6 4 3 2 1 5 6
942318468 6 5 4 3 2 1 6
942318468 6 6 5 4 3 2 1
539883183 6 6 5 4 3 2 1

result:

ok correct

Test #2:

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

input:

6
9
8
6
3
3
4

output:

942318468 6 1 2 3 4 5 6
942318468 6 2 1 3 4 5 6
942318468 6 3 2 1 4 5 6
942318468 6 4 3 2 1 5 6
942318468 6 5 4 3 2 1 6
942318468 6 6 4 3 5 2 1
539883183 6 4 3 5 2 6 1

result:

ok correct

Test #3:

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

input:

6
9
8
6
3
3
4

output:

942318468 6 1 2 3 4 5 6
942318468 6 2 1 3 4 5 6
942318468 6 3 2 1 4 5 6
942318468 6 4 3 2 1 5 6
942318468 6 5 4 3 2 1 6
942318468 6 6 4 3 5 2 1
539883183 6 4 3 5 2 6 1

result:

ok correct

Test #4:

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

input:

6
9
8
6
3
3
4

output:

942318468 6 1 2 3 4 5 6
942318468 6 2 1 3 4 5 6
942318468 6 3 2 1 4 5 6
942318468 6 4 3 2 1 5 6
942318468 6 5 4 3 2 1 6
942318468 6 6 4 3 5 2 1
539883183 6 4 3 5 2 6 1

result:

ok correct

Test #5:

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

input:

3
1
2
1

output:

942318468 3 1 2 3
942318468 3 2 1 3
942318468 3 3 1 2
539883183 3 1 3 2

result:

ok correct

Test #6:

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

input:

6
0
1
2
3
4
5

output:

942318468 6 1 2 3 4 5 6
942318468 6 2 1 3 4 5 6
942318468 6 3 1 2 4 5 6
942318468 6 4 1 2 3 5 6
942318468 6 5 1 2 3 4 6
942318468 6 6 1 2 3 4 5
539883183 6 1 2 3 4 5 6

result:

ok correct

Test #7:

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

input:

6
9
8
6
3
3
4

output:

942318468 6 1 2 3 4 5 6
942318468 6 2 1 3 4 5 6
942318468 6 3 2 1 4 5 6
942318468 6 4 3 2 1 5 6
942318468 6 5 4 3 2 1 6
942318468 6 6 4 3 5 2 1
539883183 6 4 3 5 2 6 1

result:

ok correct

Subtask #2:

score: 15
Accepted

Test #8:

score: 15
Accepted
time: 1ms
memory: 3800kb

input:

40
394
395
394
394
388
389
390
380
375
368
368
369
352
351
358
329
341
338
322
331
307
299
275
254
271
252
244
245
233
233
215
194
162
132
105
106
53
78
8
31

output:

942318468 40 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
942318468 40 2 1 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
942318468 40 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 ...

result:

ok correct

Test #9:

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

input:

40
394
395
394
394
388
389
390
380
375
368
368
369
352
351
358
329
341
338
322
331
307
299
275
254
271
252
244
245
233
233
215
194
162
132
105
106
53
78
8
31

output:

942318468 40 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
942318468 40 2 1 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
942318468 40 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 ...

result:

ok correct

Test #10:

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

input:

40
394
395
394
394
388
389
390
380
375
368
368
369
352
351
358
329
341
338
322
331
307
299
275
254
271
252
244
245
233
233
215
194
162
132
105
106
53
78
8
31

output:

942318468 40 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
942318468 40 2 1 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
942318468 40 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 ...

result:

ok correct

Test #11:

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

input:

40
394
395
394
394
388
389
390
380
375
368
368
369
352
351
358
329
341
338
322
331
307
299
275
254
271
252
244
245
233
233
215
194
162
132
105
106
53
78
8
31

output:

942318468 40 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
942318468 40 2 1 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
942318468 40 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 ...

result:

ok correct

Test #12:

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

input:

40
780
779
777
774
770
765
759
752
744
735
725
714
702
689
675
660
644
627
609
590
570
549
527
504
480
455
429
402
374
345
315
284
252
219
185
150
114
77
39
0

output:

942318468 40 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
942318468 40 2 1 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
942318468 40 3 2 1 4 5 6 7 8 9 10 11 12 13 14 15 16 ...

result:

ok correct

Test #13:

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

input:

40
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

output:

942318468 40 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
942318468 40 2 1 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
942318468 40 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 ...

result:

ok correct

Subtask #3:

score: 15
Accepted

Test #14:

score: 15
Accepted
time: 0ms
memory: 3852kb

input:

250
31125
31124
31122
31119
31115
31110
31104
31097
31089
31080
31070
31059
31047
31034
31020
31005
30989
30972
30954
30935
30915
30894
30872
30849
30825
30800
30774
30747
30719
30690
30660
30629
30597
30564
30530
30495
30459
30422
30384
30345
30305
30264
30222
30179
30135
30090
30044
29997
29949
29...

output:

942318468 250 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 9...

result:

ok correct

Test #15:

score: 0
Accepted
time: 4ms
memory: 4064kb

input:

250
15389
15388
15390
15389
15391
15392
15389
15388
15381
15375
15362
15353
15340
15353
15332
15314
15330
15307
15310
15314
15312
15303
15280
15252
15267
15228
15251
15216
15197
15193
15206
15191
15194
15162
15159
15153
15093
15109
15118
15078
15034
15064
15051
14982
15008
14944
14947
14923
14867
14...

output:

942318468 250 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 9...

result:

ok correct

Test #16:

score: 0
Accepted
time: 4ms
memory: 3804kb

input:

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

output:

942318468 250 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 9...

result:

ok correct

Test #17:

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

input:

250
15389
15388
15390
15389
15391
15392
15389
15388
15381
15375
15362
15353
15340
15353
15332
15314
15330
15307
15310
15314
15312
15303
15280
15252
15267
15228
15251
15216
15197
15193
15206
15191
15194
15162
15159
15153
15093
15109
15118
15078
15034
15064
15051
14982
15008
14944
14947
14923
14867
14...

output:

942318468 250 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 9...

result:

ok correct

Test #18:

score: 0
Accepted
time: 4ms
memory: 3784kb

input:

250
15389
15388
15390
15389
15391
15392
15389
15388
15381
15375
15362
15353
15340
15353
15332
15314
15330
15307
15310
15314
15312
15303
15280
15252
15267
15228
15251
15216
15197
15193
15206
15191
15194
15162
15159
15153
15093
15109
15118
15078
15034
15064
15051
14982
15008
14944
14947
14923
14867
14...

output:

942318468 250 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 9...

result:

ok correct

Test #19:

score: 0
Accepted
time: 4ms
memory: 4056kb

input:

250
15389
15388
15390
15389
15391
15392
15389
15388
15381
15375
15362
15353
15340
15353
15332
15314
15330
15307
15310
15314
15312
15303
15280
15252
15267
15228
15251
15216
15197
15193
15206
15191
15194
15162
15159
15153
15093
15109
15118
15078
15034
15064
15051
14982
15008
14944
14947
14923
14867
14...

output:

942318468 250 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 9...

result:

ok correct

Subtask #4:

score: 15
Accepted

Test #20:

score: 15
Accepted
time: 7ms
memory: 4064kb

input:

444
48125
48124
48124
48122
48119
48117
48111
48117
48104
48096
48085
48076
48063
48076
48077
48048
48052
48059
48040
48035
48040
48019
47998
47972
47975
47942
47949
47958
47917
47937
47919
47898
47895
47900
47864
47881
47814
47832
47812
47820
47797
47776
47793
47717
47711
47661
47683
47630
47582
47...

output:

942318468 444 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 9...

result:

ok correct

Test #21:

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

input:

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

output:

942318468 444 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 9...

result:

ok correct

Test #22:

score: 0
Accepted
time: 13ms
memory: 4060kb

input:

444
48125
48124
48124
48122
48119
48117
48111
48117
48104
48096
48085
48076
48063
48076
48077
48048
48052
48059
48040
48035
48040
48019
47998
47972
47975
47942
47949
47958
47917
47937
47919
47898
47895
47900
47864
47881
47814
47832
47812
47820
47797
47776
47793
47717
47711
47661
47683
47630
47582
47...

output:

942318468 444 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 9...

result:

ok correct

Test #23:

score: 0
Accepted
time: 13ms
memory: 3792kb

input:

444
48125
48124
48124
48122
48119
48117
48111
48117
48104
48096
48085
48076
48063
48076
48077
48048
48052
48059
48040
48035
48040
48019
47998
47972
47975
47942
47949
47958
47917
47937
47919
47898
47895
47900
47864
47881
47814
47832
47812
47820
47797
47776
47793
47717
47711
47661
47683
47630
47582
47...

output:

942318468 444 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 9...

result:

ok correct

Test #24:

score: 0
Accepted
time: 9ms
memory: 3800kb

input:

444
98346
98345
98343
98340
98336
98331
98325
98318
98310
98301
98291
98280
98268
98255
98241
98226
98210
98193
98175
98156
98136
98115
98093
98070
98046
98021
97995
97968
97940
97911
97881
97850
97818
97785
97751
97716
97680
97643
97605
97566
97526
97485
97443
97400
97356
97311
97265
97218
97170
97...

output:

942318468 444 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 9...

result:

ok correct

Test #25:

score: 0
Accepted
time: 9ms
memory: 3748kb

input:

444
48125
48124
48124
48122
48119
48117
48111
48117
48104
48096
48085
48076
48063
48076
48077
48048
48052
48059
48040
48035
48040
48019
47998
47972
47975
47942
47949
47958
47917
47937
47919
47898
47895
47900
47864
47881
47814
47832
47812
47820
47797
47776
47793
47717
47711
47661
47683
47630
47582
47...

output:

942318468 444 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 9...

result:

ok correct

Subtask #5:

score: 20
Accepted

Test #26:

score: 20
Accepted
time: 318ms
memory: 4076kb

input:

2000
984031
984030
984030
984030
984024
984025
984024
984013
984007
984015
983996
984005
983995
984000
983978
983961
983965
983956
983937
983942
983926
983928
983932
983890
983887
983863
983837
983857
983816
983795
983816
983806
983757
983744
983758
983723
983724
983733
983691
983650
983679
983636
9...

output:

942318468 2000 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 ...

result:

ok correct

Test #27:

score: 0
Accepted
time: 309ms
memory: 3808kb

input:

2000
984031
984030
984030
984030
984024
984025
984024
984013
984007
984015
983996
984005
983995
984000
983978
983961
983965
983956
983937
983942
983926
983928
983932
983890
983887
983863
983837
983857
983816
983795
983816
983806
983757
983744
983758
983723
983724
983733
983691
983650
983679
983636
9...

output:

942318468 2000 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 ...

result:

ok correct

Test #28:

score: 0
Accepted
time: 331ms
memory: 3812kb

input:

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

output:

942318468 2000 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 ...

result:

ok correct

Test #29:

score: 0
Accepted
time: 293ms
memory: 4092kb

input:

2000
1999000
1998999
1998997
1998994
1998990
1998985
1998979
1998972
1998964
1998955
1998945
1998934
1998922
1998909
1998895
1998880
1998864
1998847
1998829
1998810
1998790
1998769
1998747
1998724
1998700
1998675
1998649
1998622
1998594
1998565
1998535
1998504
1998472
1998439
1998405
1998370
1998334...

output:

942318468 2000 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 ...

result:

ok correct

Test #30:

score: 0
Accepted
time: 282ms
memory: 3760kb

input:

2000
984031
984030
984030
984030
984024
984025
984024
984013
984007
984015
983996
984005
983995
984000
983978
983961
983965
983956
983937
983942
983926
983928
983932
983890
983887
983863
983837
983857
983816
983795
983816
983806
983757
983744
983758
983723
983724
983733
983691
983650
983679
983636
9...

output:

942318468 2000 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 ...

result:

ok correct

Test #31:

score: 0
Accepted
time: 303ms
memory: 3796kb

input:

2000
984031
984030
984030
984030
984024
984025
984024
984013
984007
984015
983996
984005
983995
984000
983978
983961
983965
983956
983937
983942
983926
983928
983932
983890
983887
983863
983837
983857
983816
983795
983816
983806
983757
983744
983758
983723
983724
983733
983691
983650
983679
983636
9...

output:

942318468 2000 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 ...

result:

ok correct

Subtask #6:

score: 30
Accepted

Test #32:

score: 30
Accepted
time: 1303ms
memory: 4112kb

input:

4000
3954555
3954556
3954555
3954551
3954547
3954552
3954549
3954544
3954533
3954532
3954534
3954523
3954525
3954513
3954512
3954488
3954478
3954464
3954445
3954455
3954444
3954447
3954429
3954437
3954400
3954375
3954349
3954347
3954310
3954319
3954299
3954277
3954237
3954262
3954230
3954219
3954215...

output:

942318468 4000 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 ...

result:

ok correct

Test #33:

score: 0
Accepted
time: 1471ms
memory: 4112kb

input:

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

output:

942318468 4000 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 ...

result:

ok correct

Test #34:

score: 0
Accepted
time: 1312ms
memory: 3780kb

input:

4000
3954555
3954556
3954555
3954551
3954547
3954552
3954549
3954544
3954533
3954532
3954534
3954523
3954525
3954513
3954512
3954488
3954478
3954464
3954445
3954455
3954444
3954447
3954429
3954437
3954400
3954375
3954349
3954347
3954310
3954319
3954299
3954277
3954237
3954262
3954230
3954219
3954215...

output:

942318468 4000 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 ...

result:

ok correct

Test #35:

score: 0
Accepted
time: 1366ms
memory: 3784kb

input:

4000
7998000
7997999
7997997
7997994
7997990
7997985
7997979
7997972
7997964
7997955
7997945
7997934
7997922
7997909
7997895
7997880
7997864
7997847
7997829
7997810
7997790
7997769
7997747
7997724
7997700
7997675
7997649
7997622
7997594
7997565
7997535
7997504
7997472
7997439
7997405
7997370
7997334...

output:

942318468 4000 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 ...

result:

ok correct

Test #36:

score: 0
Accepted
time: 1423ms
memory: 3892kb

input:

4000
3954555
3954556
3954555
3954551
3954547
3954552
3954549
3954544
3954533
3954532
3954534
3954523
3954525
3954513
3954512
3954488
3954478
3954464
3954445
3954455
3954444
3954447
3954429
3954437
3954400
3954375
3954349
3954347
3954310
3954319
3954299
3954277
3954237
3954262
3954230
3954219
3954215...

output:

942318468 4000 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 ...

result:

ok correct

Test #37:

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

input:

4000
3954555
3954556
3954555
3954551
3954547
3954552
3954549
3954544
3954533
3954532
3954534
3954523
3954525
3954513
3954512
3954488
3954478
3954464
3954445
3954455
3954444
3954447
3954429
3954437
3954400
3954375
3954349
3954347
3954310
3954319
3954299
3954277
3954237
3954262
3954230
3954219
3954215...

output:

942318468 4000 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 ...

result:

ok correct