QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#287251#4205. Art Collectionshonglan0301100 ✓1505ms4148kbC++175.1kb2023-12-20 08:31:282023-12-20 08:31:29

Judging History

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

  • [2023-12-20 08:31:29]
  • 评测
  • 测评结果:100
  • 用时:1505ms
  • 内存:4148kb
  • [2023-12-20 08:31:28]
  • 提交

answer

/*
  author: honglan0301
  Sexy_goodier _ xiaoqing
 */
#include "art.h"
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cctype>
#include <queue>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <cmath>
#include <set>
#include <bitset>
#include <assert.h>
//#include <art.h>
using namespace std;

//namespace Fread{const int SIZE=1<<20;char buf[SIZE],*S,*T;inline char getchar(){if(S==T){T=(S=buf)+fread(buf,1,SIZE,stdin);if(S==T)return'\n';}return*S++;}}using namespace Fread;namespace Fwrite{const int SIZE=1<<20;char buf[SIZE],*S=buf,*T=buf+SIZE;inline void flush(){fwrite(buf,1,S-buf,stdout);S=buf;}inline void putchar(char c){*S++=c;if(S==T)flush();}struct NTR{~NTR(){flush();}}ztr;}using namespace Fwrite;
//#define getchar Fread::getchar
//#define putchar Fwrite::putchar

namespace Fastio{struct Reader{template<typename T>Reader&operator>>(T&x){x=0;short f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f*=-1;c=getchar();}while(c>='0'&&c<='9')x=(x<<3)+(x<<1)+(c^48),c=getchar();x*=f;return*this;}Reader&operator>>(double&x){x=0;double t=0;short f=1,s=0;char c=getchar();while((c<'0'||c>'9')&&c!='.'){if(c=='-')f*=-1;c=getchar();}while(c>='0'&&c<='9'&&c!='.')x=x*10+(c^48),c=getchar();if(c=='.')c=getchar();else{x*=f;return*this;}while(c>='0'&&c<='9')t=t*10+(c^48),s++,c=getchar();while(s--)t/=10.0;x=(x+t)*f;return*this;}Reader&operator>>(long double&x){x=0;long double t=0;short f=1,s=0;char c=getchar();while((c<'0'||c>'9')&&c!='.'){if(c=='-')f*=-1;c=getchar();}while(c>='0'&&c<='9'&&c!='.')x=x*10+(c^48),c=getchar();if(c=='.')c=getchar();else{x*=f;return*this;}while(c>='0'&&c<='9')t=t*10+(c^48),s++,c=getchar();while(s--)t/=10.0;x=(x+t)*f;return*this;}Reader&operator>>(__float128&x){x=0;__float128 t=0;short f=1,s=0;char c=getchar();while((c<'0'||c>'9')&&c!='.'){if(c=='-')f*=-1;c=getchar();}while(c>='0'&&c<='9'&&c!='.')x=x*10+(c^48),c=getchar();if(c=='.')c=getchar();else{x*=f;return*this;}while(c>='0'&&c<='9')t=t*10+(c^48),s++,c=getchar();while(s--)t/=10.0;x=(x+t)*f;return*this;}Reader&operator>>(char&c){c=getchar();while(c==' '||c=='\n'||c=='\r')c=getchar();return*this;}Reader&operator>>(char*str){int len=0;char c=getchar();while(c==' '||c=='\n'||c=='\r')c=getchar();while(c!=' '&&c!='\n'&&c!='\r')str[len++]=c,c=getchar();str[len]='\0';return*this;}Reader&operator>>(string&str){str.clear();char c=getchar();while(c==' '||c=='\n'||c=='\r')c=getchar();while(c!=' '&&c!='\n'&&c!='\r')str.push_back(c),c=getchar();return*this;}Reader(){}}cin;const char endl='\n';struct Writer{const int Setprecision=6;typedef int mxdouble;template<typename T>Writer&operator<<(T x){if(x==0){putchar('0');return*this;}if(x<0)putchar('-'),x=-x;static short sta[40];short top=0;while(x>0)sta[++top]=x%10,x/=10;while(top>0)putchar(sta[top]+'0'),top--;return*this;}Writer&operator<<(double x){if(x<0)putchar('-'),x=-x;mxdouble _=x;x-=(double)_;static short sta[40];short top=0;while(_>0)sta[++top]=_%10,_/=10;if(top==0)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;putchar('.');for(int i=0;i<Setprecision;i++)x*=10;_=x;while(_>0)sta[++top]=_%10,_/=10;for(int i=0;i<Setprecision-top;i++)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;return*this;}Writer&operator<<(long double x){if(x<0)putchar('-'),x=-x;mxdouble _=x;x-=(long double)_;static short sta[40];short top=0;while(_>0)sta[++top]=_%10,_/=10;if(top==0)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;putchar('.');for(int i=0;i<Setprecision;i++)x*=10;_=x;while(_>0)sta[++top]=_%10,_/=10;for(int i=0;i<Setprecision-top;i++)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;return*this;}Writer&operator<<(__float128 x){if(x<0)putchar('-'),x=-x;mxdouble _=x;x-=(__float128)_;static short sta[40];short top=0;while(_>0)sta[++top]=_%10,_/=10;if(top==0)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;putchar('.');for(int i=0;i<Setprecision;i++)x*=10;_=x;while(_>0)sta[++top]=_%10,_/=10;for(int i=0;i<Setprecision-top;i++)putchar('0');while(top>0)putchar(sta[top]+'0'),top--;return*this;}Writer&operator<<(char c){putchar(c);return*this;}Writer&operator<<(char*str){int cur=0;while(str[cur])putchar(str[cur++]);return*this;}Writer&operator<<(const char*str){int cur=0;while(str[cur])putchar(str[cur++]);return*this;}Writer&operator<<(string str){int st=0,ed=str.size();while(st<ed)putchar(str[st++]);return*this;}Writer(){}}cout;}using namespace Fastio;
#define cin Fastio::cin
#define cout Fastio::cout
#define endl Fastio::endl//;fflush(stdout)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define mod 998244353

int n,a[4005],lst,nx;

void cc(int x,int k)
{
	int ncnt=0;
	for(int i=1;i<=n;i++)
	{
		if(!a[i]) ncnt++; if(ncnt==x) {a[i]=k; return;}
	}
}
void solve(int N)
{
	n=N;
	vector <int> hh; hh.clear();
	for(int i=1;i<=n;i++) hh.pb(i); lst=publish(hh);
	for(int i=n;i>=2;i--)
	{
		hh.clear();
		for(int j=n;j>=i;j--) hh.pb(j); for(int j=1;j<=i-1;j++) hh.pb(j); nx=publish(hh);
		int nwz=(nx-lst+(i-1))/2; cc(nwz+1,i); lst=nx;
	}
	cc(1,1);
	vector <int> ans; 
	for(int i=1;i<=n;i++) ans.pb(a[i]); answer(ans);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

6
15
10
6
3
1
0

output:

942318468 6 1 2 3 4 5 6
942318468 6 6 1 2 3 4 5
942318468 6 6 5 1 2 3 4
942318468 6 6 5 4 1 2 3
942318468 6 6 5 4 3 1 2
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: 3812kb

input:

6
9
12
12
9
7
6

output:

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

result:

ok correct

Test #3:

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

input:

6
9
12
12
9
7
6

output:

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

result:

ok correct

Test #4:

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

input:

6
9
12
12
9
7
6

output:

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

result:

ok correct

Test #5:

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

input:

3
1
1
2

output:

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

result:

ok correct

Test #6:

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

input:

6
0
5
9
12
14
15

output:

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

result:

ok correct

Test #7:

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

input:

6
9
12
12
9
7
6

output:

942318468 6 1 2 3 4 5 6
942318468 6 6 1 2 3 4 5
942318468 6 6 5 1 2 3 4
942318468 6 6 5 4 1 2 3
942318468 6 6 5 4 3 1 2
942318468 6 6 5 4 3 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: 3808kb

input:

40
394
417
379
406
374
381
359
336
318
315
321
340
350
367
373
376
396
379
365
364
358
375
373
384
396
381
395
396
388
395
397
392
388
383
387
388
384
385
385
386

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

result:

ok correct

Test #9:

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

input:

40
394
417
379
406
374
381
359
336
318
315
321
340
350
367
373
376
396
379
365
364
358
375
373
384
396
381
395
396
388
395
397
392
388
383
387
388
384
385
385
386

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

result:

ok correct

Test #10:

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

input:

40
394
417
379
406
374
381
359
336
318
315
321
340
350
367
373
376
396
379
365
364
358
375
373
384
396
381
395
396
388
395
397
392
388
383
387
388
384
385
385
386

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

result:

ok correct

Test #11:

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

input:

40
394
417
379
406
374
381
359
336
318
315
321
340
350
367
373
376
396
379
365
364
358
375
373
384
396
381
395
396
388
395
397
392
388
383
387
388
384
385
385
386

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

result:

ok correct

Test #12:

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

input:

40
780
741
703
666
630
595
561
528
496
465
435
406
378
351
325
300
276
253
231
210
190
171
153
136
120
105
91
78
66
55
45
36
28
21
15
10
6
3
1
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 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
942318468 40 40 39 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ...

result:

ok correct

Test #13:

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

input:

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

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

result:

ok correct

Subtask #3:

score: 15
Accepted

Test #14:

score: 15
Accepted
time: 4ms
memory: 3764kb

input:

250
31125
30876
30628
30381
30135
29890
29646
29403
29161
28920
28680
28441
28203
27966
27730
27495
27261
27028
26796
26565
26335
26106
25878
25651
25425
25200
24976
24753
24531
24310
24090
23871
23653
23436
23220
23005
22791
22578
22366
22155
21945
21736
21528
21321
21115
20910
20706
20503
20301
20...

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: 5ms
memory: 4076kb

input:

250
15389
15632
15558
15777
15865
15846
15630
15811
16015
16160
16298
16215
16295
16442
16586
16549
16597
16396
16418
16519
16589
16790
16932
17027
17139
17094
16926
16779
16687
16598
16674
16501
16491
16326
16510
16701
16655
16526
16328
16207
16203
16100
16130
16179
16179
15982
16096
16039
16239
16...

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: 3816kb

input:

250
0
249
497
744
990
1235
1479
1722
1964
2205
2445
2684
2922
3159
3395
3630
3864
4097
4329
4560
4790
5019
5247
5474
5700
5925
6149
6372
6594
6815
7035
7254
7472
7689
7905
8120
8334
8547
8759
8970
9180
9389
9597
9804
10010
10215
10419
10622
10824
11025
11225
11424
11622
11819
12015
12210
12404
12597...

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: 4ms
memory: 3816kb

input:

250
15389
15632
15558
15777
15865
15846
15630
15811
16015
16160
16298
16215
16295
16442
16586
16549
16597
16396
16418
16519
16589
16790
16932
17027
17139
17094
16926
16779
16687
16598
16674
16501
16491
16326
16510
16701
16655
16526
16328
16207
16203
16100
16130
16179
16179
15982
16096
16039
16239
16...

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: 5ms
memory: 3784kb

input:

250
15389
15632
15558
15777
15865
15846
15630
15811
16015
16160
16298
16215
16295
16442
16586
16549
16597
16396
16418
16519
16589
16790
16932
17027
17139
17094
16926
16779
16687
16598
16674
16501
16491
16326
16510
16701
16655
16526
16328
16207
16203
16100
16130
16179
16179
15982
16096
16039
16239
16...

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: 3812kb

input:

250
15389
15632
15558
15777
15865
15846
15630
15811
16015
16160
16298
16215
16295
16442
16586
16549
16597
16396
16418
16519
16589
16790
16932
17027
17139
17094
16926
16779
16687
16598
16674
16501
16491
16326
16510
16701
16655
16526
16328
16207
16203
16100
16130
16179
16179
15982
16096
16039
16239
16...

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: 11ms
memory: 3800kb

input:

444
48125
47714
48088
47755
47671
47336
47640
47823
47961
47964
48348
48161
47873
48094
48414
48197
48219
48518
48318
48231
48113
47884
47646
47775
48143
48266
48474
48623
48267
48264
48038
47739
48119
48508
48696
48291
48617
48372
48654
48465
48449
48844
48642
48503
48557
48858
49002
49377
49069
48...

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: 11ms
memory: 3800kb

input:

444
0
443
885
1326
1766
2205
2643
3080
3516
3951
4385
4818
5250
5681
6111
6540
6968
7395
7821
8246
8670
9093
9515
9936
10356
10775
11193
11610
12026
12441
12855
13268
13680
14091
14501
14910
15318
15725
16131
16536
16940
17343
17745
18146
18546
18945
19343
19740
20136
20531
20925
21318
21710
22101
2...

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: 11ms
memory: 3804kb

input:

444
48125
47714
48088
47755
47671
47336
47640
47823
47961
47964
48348
48161
47873
48094
48414
48197
48219
48518
48318
48231
48113
47884
47646
47775
48143
48266
48474
48623
48267
48264
48038
47739
48119
48508
48696
48291
48617
48372
48654
48465
48449
48844
48642
48503
48557
48858
49002
49377
49069
48...

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: 10ms
memory: 3808kb

input:

444
48125
47714
48088
47755
47671
47336
47640
47823
47961
47964
48348
48161
47873
48094
48414
48197
48219
48518
48318
48231
48113
47884
47646
47775
48143
48266
48474
48623
48267
48264
48038
47739
48119
48508
48696
48291
48617
48372
48654
48465
48449
48844
48642
48503
48557
48858
49002
49377
49069
48...

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: 8ms
memory: 3772kb

input:

444
98346
97903
97461
97020
96580
96141
95703
95266
94830
94395
93961
93528
93096
92665
92235
91806
91378
90951
90525
90100
89676
89253
88831
88410
87990
87571
87153
86736
86320
85905
85491
85078
84666
84255
83845
83436
83028
82621
82215
81810
81406
81003
80601
80200
79800
79401
79003
78606
78210
77...

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: 0ms
memory: 3860kb

input:

444
48125
47714
48088
47755
47671
47336
47640
47823
47961
47964
48348
48161
47873
48094
48414
48197
48219
48518
48318
48231
48113
47884
47646
47775
48143
48266
48474
48623
48267
48264
48038
47739
48119
48508
48696
48291
48617
48372
48654
48465
48449
48844
48642
48503
48557
48858
49002
49377
49069
48...

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: 317ms
memory: 4104kb

input:

2000
984031
985424
986238
985653
984359
984260
985304
987049
988815
987986
987888
988241
987243
988454
987020
987567
988353
989584
988894
990809
992347
991138
989940
987979
989401
989360
990068
991973
991841
990122
991440
989771
988699
989174
989562
988997
987605
987798
989592
988443
990067
991348
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: 313ms
memory: 3800kb

input:

2000
984031
985424
986238
985653
984359
984260
985304
987049
988815
987986
987888
988241
987243
988454
987020
987567
988353
989584
988894
990809
992347
991138
989940
987979
989401
989360
990068
991973
991841
990122
991440
989771
988699
989174
989562
988997
987605
987798
989592
988443
990067
991348
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: 318ms
memory: 4108kb

input:

2000
0
1999
3997
5994
7990
9985
11979
13972
15964
17955
19945
21934
23922
25909
27895
29880
31864
33847
35829
37810
39790
41769
43747
45724
47700
49675
51649
53622
55594
57565
59535
61504
63472
65439
67405
69370
71334
73297
75259
77220
79180
81139
83097
85054
87010
88965
90919
92872
94824
96775
9872...

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: 281ms
memory: 3848kb

input:

2000
1999000
1997001
1995003
1993006
1991010
1989015
1987021
1985028
1983036
1981045
1979055
1977066
1975078
1973091
1971105
1969120
1967136
1965153
1963171
1961190
1959210
1957231
1955253
1953276
1951300
1949325
1947351
1945378
1943406
1941435
1939465
1937496
1935528
1933561
1931595
1929630
1927666...

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: 290ms
memory: 3884kb

input:

2000
984031
985424
986238
985653
984359
984260
985304
987049
988815
987986
987888
988241
987243
988454
987020
987567
988353
989584
988894
990809
992347
991138
989940
987979
989401
989360
990068
991973
991841
990122
991440
989771
988699
989174
989562
988997
987605
987798
989592
988443
990067
991348
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: 307ms
memory: 4108kb

input:

2000
984031
985424
986238
985653
984359
984260
985304
987049
988815
987986
987888
988241
987243
988454
987020
987567
988353
989584
988894
990809
992347
991138
989940
987979
989401
989360
990068
991973
991841
990122
991440
989771
988699
989174
989562
988997
987605
987798
989592
988443
990067
991348
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: 1230ms
memory: 3836kb

input:

4000
3954555
3957010
3956836
3956317
3953181
3953358
3956728
3953817
3952571
3956200
3952752
3950547
3949441
3951114
3952180
3952119
3949917
3946610
3945402
3947077
3943851
3943734
3943744
3942915
3942193
3940830
3938330
3941675
3942777
3940422
3943656
3945003
3947349
3944998
3943016
3942805
3941545...

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: 1228ms
memory: 3820kb

input:

4000
0
3999
7997
11994
15990
19985
23979
27972
31964
35955
39945
43934
47922
51909
55895
59880
63864
67847
71829
75810
79790
83769
87747
91724
95700
99675
103649
107622
111594
115565
119535
123504
127472
131439
135405
139370
143334
147297
151259
155220
159180
163139
167097
171054
175010
178965
18291...

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: 1505ms
memory: 3928kb

input:

4000
3954555
3957010
3956836
3956317
3953181
3953358
3956728
3953817
3952571
3956200
3952752
3950547
3949441
3951114
3952180
3952119
3949917
3946610
3945402
3947077
3943851
3943734
3943744
3942915
3942193
3940830
3938330
3941675
3942777
3940422
3943656
3945003
3947349
3944998
3943016
3942805
3941545...

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: 1496ms
memory: 4148kb

input:

4000
7998000
7994001
7990003
7986006
7982010
7978015
7974021
7970028
7966036
7962045
7958055
7954066
7950078
7946091
7942105
7938120
7934136
7930153
7926171
7922190
7918210
7914231
7910253
7906276
7902300
7898325
7894351
7890378
7886406
7882435
7878465
7874496
7870528
7866561
7862595
7858630
7854666...

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: 1352ms
memory: 3836kb

input:

4000
3954555
3957010
3956836
3956317
3953181
3953358
3956728
3953817
3952571
3956200
3952752
3950547
3949441
3951114
3952180
3952119
3949917
3946610
3945402
3947077
3943851
3943734
3943744
3942915
3942193
3940830
3938330
3941675
3942777
3940422
3943656
3945003
3947349
3944998
3943016
3942805
3941545...

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: 1242ms
memory: 3856kb

input:

4000
3954555
3957010
3956836
3956317
3953181
3953358
3956728
3953817
3952571
3956200
3952752
3950547
3949441
3951114
3952180
3952119
3949917
3946610
3945402
3947077
3943851
3943734
3943744
3942915
3942193
3940830
3938330
3941675
3942777
3940422
3943656
3945003
3947349
3944998
3943016
3942805
3941545...

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