QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#75409#5033. Y 君的序列xlwang70 377ms292916kbC++145.9kb2023-02-05 09:27:012023-02-05 09:27:03

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-05 09:27:03]
  • 评测
  • 测评结果:70
  • 用时:377ms
  • 内存:292916kb
  • [2023-02-05 09:27:01]
  • 提交

answer

// #include <bits/stdc++.h>
// #include "seq.h"
// #define fr(i,j,k) for(register int i=j;i<=k;++i)
// #define rf(i,j,k) for(register int i=j;i>=k;--i)
// using namespace std;
// const int Maxn=1e5+10;
// int b[Maxn];
// int a[Maxn];
// int n;
// int id[Maxn];
// int id1[Maxn];
// inline void Swap(int x,int y){
// 	swap(a[x],a[y]);
// 	id1[a[x]]=x,id1[a[y]]=y;
// }
// inline void add1(int x,int y){
// 	a[y]+=a[x]/2;
// 	a[x]/=2;
// }
// inline void into(int l,int r){
// 	fr(i,l+1,r-1) add(id1[i],id1[i+1]);add(id1[r],id1[1]);
// 	// fr(i,l+1,r-1) printf("add:%d %d\n",id1[i],id1[i+1]);
// 	// printf("add:%d %d\n",id1[r],id1[1]);
// 	fr(i,l+1,r-1) add1(id1[i],id1[i+1]);add1(id1[r],id1[1]);
// 	fr(i,1,n) id1[a[i]]=i;
// }
// inline void solve(){
// 	answer(1);
// 	fr(i,1,n) b[i]=Get(i);
// 	fr(i,1,n) id[b[i]]=i;
// 	fr(i,1,n) a[i]=i;
// 	fr(i,1,n) id1[a[i]]=i;
// 	// puts("id:");
// 	// fr(i,1,n) printf("%d ",id[i]);
// 	// puts("");
// 	// puts("id1:");
// 	// fr(i,1,n) printf("%d ",id1[i]);
// 	// puts("");
// 	rf(i,n,1){
// 		// printf("** %d %d\n",id[i],i);
// 		while(a[id[i]]!=i) into(1,i);
// 	}
// }
// void SEQ(int N,int M){
// 	n=N;
// 	solve();
// }
// #include <bits/stdc++.h>
// #include "seq.h"
// #define fr(i,j,k) for(register int i=j;i<=k;++i)
// #define rf(i,j,k) for(register int i=j;i>=k;--i)
// using namespace std;
// int n;
// const int Maxn=1e5+10;
// int a[Maxn];
// int id[Maxn];
// inline void Swap(int x,int y){
// 	swap(a[x],a[y]);
// 	id[a[x]]=x;id[a[y]]=y;
// }
// int fa[Maxn];
// vector<pair<int,int> >vc,vc1;
// int pow2[35];
// inline void into(){
// 	fr(i,2,n){
// 		fr(j,0,30){
// 			if(pow2[j]<=i) continue;
// 			fa[j]=pow2[j]-i;
// 			break;
// 		}
// 	}
// }
// int dep[Maxn];
// inline void chk(int x,int y){
// 	int xx,yy;
// 	xx=x,yy=y;
// 	fr(i,1,25){
// 		if(xx%2==0) vc1.push_back(make_pair(id[x],id[y])),yy+=xx/2,xx/=2;
// 		else vc1.push_back(make_pair(id[y],id[x])),xx+=yy/2,yy/=2;
// 		if(xx==y && yy==x) break;
// 	}
// 	Swap(x,y);return;
// }
// inline void getid(int x,int y){
// 	vc1.clear();
// 	if(dep[x]<dep[y]) swap(x,y);
// 	while(dep[x]!=dep[y]){
// 		vc1.push_back(make_pair(x,fa[x]));
// 		chk(x,fa[x]);x=fa[x];
// 	}
// 	while(x!=y){
// 		vc1.push_back(make_pair(x,fa[x]));
// 		vc1.push_back(make_pair(y,fa[y]));
// 		x=fa[x];y=fa[y];
// 	}
// 	for(register int i=vc.size()-2;i>=0;--i) chk(vc[i].first,vc[i].second);
// }
// inline void SEQ(int _n,int M) {
// 	// answer(1);
// 	// n=_n;
// 	// fr(i,1,n) a[i]=Get(i),id[a[i]]=i;
// 	// pow2[0]=1;
// 	// fr(i,1,25) pow2[i]=pow2[i-1]*2;
// 	// fr(i,0,25) pow2[i]++;
// 	// into();
// 	// dep[1]=1;
// 	// fr(i,2,n) dep[i]=dep[fa[i]]+1;
// 	// fr(i,1,n) if(id[i]!=i) getid(i,id[i]);
// // 	reverse(vc.begin(),vc.end());
// // 	for(register int i=0;i<vc.size();++i) add(vc[i].first,vc[i].second);
// }
#include <bits/stdc++.h>
#include "seq.h"
#define fr(i,j,k) for(register int i=j;i<=k;++i)
#define rf(i,j,k) for(register int i=j;i>=k;--i)
using namespace std;
int n;
const int Maxn=1e5+10;
int a[Maxn];
int id[Maxn];
inline void Swap(int x,int y){
	swap(a[x],a[y]);
	id[a[x]]=x;id[a[y]]=y;
}
int fa[Maxn];
vector<pair<int,int> >vc,ans;
vector<int> vc1,vc2;
int pow2[35];
inline void into(){
	fr(i,2,n){
		fr(j,0,30){
			if(pow2[j]<=i) continue;
			fa[i]=pow2[j]-i;
			break;
		}
	}
}
int dep[Maxn];
inline void chk1(int x,int y){
	int xx,yy;
	xx=x,yy=y;
	// cout<<"**"<<x<<' '<<y<<' '<<id[x]<<' '<<id[y]<<endl;
	// ans.push_back(make_pair(x,y));
	fr(i,1,25){
		if(xx%2==0) vc.push_back(make_pair(id[x],id[y])),yy+=xx/2,xx/=2;
		else vc.push_back(make_pair(id[y],id[x])),xx+=yy/2,yy/=2;
		if(xx==y && yy==x) break;
	}
	Swap(id[x],id[y]);return;
}
inline void chk(int x,int y){
	int xx,yy;
	xx=x,yy=y;
	// cout<<"**"<<x<<' '<<y<<endl;
	ans.push_back(make_pair(x,y));
	// fr(i,1,25){
	// 	if(xx%2==0) vc.push_back(make_pair(id[x],id[y])),yy+=xx/2,xx/=2;
	// 	else vc.push_back(make_pair(id[y],id[x])),xx+=yy/2,yy/=2;
	// 	if(xx==y && yy==x) break;
	// }
	Swap(id[x],id[y]);return;
}
inline void out(){
	puts("qaq:");
	fr(i,1,n) cout<<i<<' ';
	cout<<endl;
	fr(i,1,n) cout<<id[i]<<' ';
	cout<<endl;
	puts("qwq");
}
inline void getid(int x,int y){
	// cout<<"***"<<x<<' '<<y<<endl;
	vc1.clear();vc2.clear();
	if(dep[x]<dep[y]) swap(x,y);
	while(dep[x]!=dep[y]){
		vc1.push_back(x);
		x=fa[x];
	}
	while(x!=y){
		vc1.push_back(x);
		vc2.push_back(y);
		x=fa[x];y=fa[y];
	}
	vc2.push_back(x);
	reverse(vc2.begin(),vc2.end());
	for(register int i=0;i<vc2.size();++i) vc1.push_back(vc2[i]);
	// cout<<vc1.size()<<endl;
	if(vc1.size()==2){
		chk(vc1[0],vc1[1]);
		return;
	}
	for(register int i=1;i<vc1.size();++i) chk(vc1[0],vc1[i]),swap(vc1[0],vc1[i]);
	for(register int i=vc1.size()-2;i>=1;--i) chk(vc1[vc1.size()-1],vc1[i]),swap(vc1[vc1.size()-1],vc1[i]);
	// cout<<vc1.size()<<endl;
	// if(vc1.size()>=2) for(register int i=vc1.size()-2;i>=0;--i) cout<<vc1[i].first<<' '<<vc1[i].second<<endl;
	// if(vc1.size()>=2) for(register int i=vc1.size()-2;i>=0;--i) chk(vc1[i].first,vc1[i].second);
	// out();
}
void SEQ(int _n,int M) {
	n=_n;
	fr(i,1,n) a[i]=Get(i),id[a[i]]=i;
	pow2[0]=1;
	fr(i,1,25) pow2[i]=pow2[i-1]*2;
	fr(i,0,25) pow2[i]++;
	// fr(i,1,25) cout<<i<<' '<<pow2[i]<<endl;
	into();
	dep[1]=1;
	fr(i,2,n) dep[i]=dep[fa[i]]+1;
	// fr(i,1,n) cout<<i<<' '<<fa[i]<<endl;
	// fr(i,1,n) cout<<i<<' '<<id[i]<<endl;
	fr(i,1,n) if(id[i]!=i) getid(a[i],a[id[i]]);
	reverse(ans.begin(),ans.end());
	fr(i,1,n) a[i]=i,id[a[i]]=i;
	// cout<<ans.size()<<endl;
	// for(register int i=0;i<ans.size();++i) cout<<ans[i].first<<' '<<ans[i].second<<endl;
	for(register int i=0;i<ans.size();++i) chk1(ans[i].first,ans[i].second);
	answer(1);
	// cout<<vc.size()<<endl;
	// for(register int i=0;i<vc.size();++i) cout<<vc[i].first<<' '<<vc[i].second<<endl;
	for(register int i=0;i<vc.size();++i) add(vc[i].first,vc[i].second);
}

詳細信息

Subtask #1:

score: 17
Accepted

Test #1:

score: 17
Accepted
time: 2ms
memory: 3516kb

input:

1 10000000
1

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #2:

score: 0
Accepted
time: 2ms
memory: 3612kb

input:

8 10000000
7 6 5 2 8 1 4 3

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #3:

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

input:

9 10000000
9 8 3 1 7 5 4 2 6

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #4:

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

input:

4 10000000
1 4 3 2

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #5:

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

input:

6 10000000
2 3 4 5 6 1

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #6:

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

input:

7 10000000
1 6 7 3 4 5 2

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #7:

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

input:

9 10000000
1 7 2 6 3 8 5 9 4

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #8:

score: 0
Accepted
time: 2ms
memory: 5556kb

input:

6 10000000
1 6 5 2 3 4

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #9:

score: 0
Accepted
time: 2ms
memory: 3516kb

input:

9 10000000
6 2 4 9 5 1 3 8 7

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #10:

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

input:

2 10000000
1 2

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #11:

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

input:

5 10000000
5 3 1 4 2

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #12:

score: 0
Accepted
time: 2ms
memory: 5432kb

input:

10 10000000
3 9 10 6 4 2 8 7 5 1

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #13:

score: 0
Accepted
time: 2ms
memory: 3452kb

input:

6 10000000
3 6 4 1 2 5

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #14:

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

input:

4 10000000
4 1 3 2

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #15:

score: 0
Accepted
time: 2ms
memory: 3448kb

input:

3 10000000
2 3 1

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #16:

score: 0
Accepted
time: 2ms
memory: 3556kb

input:

10 10000000
9 8 6 1 7 10 2 5 3 4

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #17:

score: 0
Accepted
time: 2ms
memory: 3476kb

input:

7 10000000
1 7 3 4 5 6 2

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #18:

score: 0
Accepted
time: 2ms
memory: 5644kb

input:

8 10000000
3 6 7 1 4 8 5 2

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #19:

score: 0
Accepted
time: 2ms
memory: 5708kb

input:

7 10000000
3 5 7 1 2 4 6

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #20:

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

input:

5 10000000
2 4 3 5 1

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Subtask #2:

score: 7
Accepted

Test #21:

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

input:

121 1500000
121 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...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #22:

score: 0
Accepted
time: 2ms
memory: 5576kb

input:

57 1500000
57 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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #23:

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

input:

147 1500000
147 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...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #24:

score: 0
Accepted
time: 2ms
memory: 5536kb

input:

53 1500000
53 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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #25:

score: 0
Accepted
time: 2ms
memory: 3636kb

input:

76 1500000
76 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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #26:

score: 0
Accepted
time: 2ms
memory: 3744kb

input:

146 1500000
146 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...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #27:

score: 0
Accepted
time: 2ms
memory: 3740kb

input:

70 1500000
70 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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #28:

score: 0
Accepted
time: 2ms
memory: 3704kb

input:

22 1500000
22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #29:

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

input:

149 1500000
149 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...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #30:

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

input:

24 1500000
24 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #31:

score: 0
Accepted
time: 2ms
memory: 3516kb

input:

56 1500000
56 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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #32:

score: 0
Accepted
time: 3ms
memory: 5856kb

input:

142 1500000
142 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...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #33:

score: 0
Accepted
time: 2ms
memory: 3636kb

input:

97 1500000
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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #34:

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

input:

90 1500000
90 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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #35:

score: 0
Accepted
time: 2ms
memory: 3652kb

input:

150 1500000
150 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...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #36:

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

input:

82 1500000
82 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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #37:

score: 0
Accepted
time: 2ms
memory: 5724kb

input:

9 1500000
9 1 2 3 4 5 6 7 8

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #38:

score: 0
Accepted
time: 2ms
memory: 3744kb

input:

144 1500000
144 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...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #39:

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

input:

89 1500000
89 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:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #40:

score: 0
Accepted
time: 2ms
memory: 3644kb

input:

114 1500000
114 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...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Subtask #3:

score: 14
Accepted

Dependency #2:

100%
Accepted

Test #41:

score: 14
Accepted
time: 2ms
memory: 3732kb

input:

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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #42:

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

input:

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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #43:

score: 0
Accepted
time: 2ms
memory: 3572kb

input:

149 1500000
68 25 100 50 7 69 107 126 115 104 55 110 128 70 22 13 62 23 99 27 149 105 139 71 11 26 77 3 147 120 63 108 93 148 92 24 41 131 1 35 74 60 135 140 106 88 96 80 129 72 132 109 21 31 38 44 66 123 54 94 16 118 125 86 45 82 145 87 59 122 121 64 5 10 103 4 42 67 141 76 83 32 89 30 142 136 19 3...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #44:

score: 0
Accepted
time: 2ms
memory: 3640kb

input:

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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #45:

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

input:

138 1500000
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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 11...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #46:

score: 0
Accepted
time: 2ms
memory: 3824kb

input:

147 1500000
31 110 63 124 96 1 106 142 97 126 147 51 80 93 7 4 77 136 143 141 123 5 76 95 128 81 15 29 72 30 71 121 33 82 145 39 8 20 50 75 127 94 11 90 47 68 115 129 49 101 14 36 3 144 130 13 16 131 119 60 103 24 42 2 111 62 28 89 19 67 88 58 125 117 54 56 146 61 41 140 109 23 105 21 26 37 52 102 1...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #47:

score: 0
Accepted
time: 2ms
memory: 3660kb

input:

138 1500000
8 13 62 60 27 109 106 104 68 41 82 52 26 116 136 11 63 108 124 86 101 102 135 118 2 138 57 15 76 64 43 81 127 89 132 133 9 36 24 1 4 85 128 35 99 84 58 6 12 69 88 94 123 97 38 14 134 72 51 130 122 28 39 79 95 91 5 117 66 83 100 40 67 115 55 31 20 61 107 121 53 114 77 105 46 78 48 17 92 9...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #48:

score: 0
Accepted
time: 2ms
memory: 3576kb

input:

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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #49:

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

input:

146 1500000
100 55 108 124 68 120 36 102 31 47 96 81 86 126 113 76 54 142 10 41 49 39 44 69 73 78 106 138 70 125 58 110 144 14 123 112 51 72 62 82 26 118 101 130 132 66 104 136 93 128 5 67 23 52 57 119 22 61 16 141 79 109 139 63 56 53 50 46 84 9 20 18 140 8 27 115 42 94 75 1 122 34 95 65 37 116 30 9...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #50:

score: 0
Accepted
time: 2ms
memory: 3656kb

input:

136 1500000
79 118 6 58 51 111 106 71 126 93 129 63 101 13 73 53 45 108 128 3 21 7 65 117 100 35 54 123 52 1 17 44 127 81 26 34 134 16 96 112 92 120 135 136 60 41 83 14 32 5 99 97 24 107 38 33 20 102 74 113 64 8 130 22 84 27 28 19 91 49 82 105 116 31 109 94 114 124 85 29 75 121 66 37 77 90 122 10 95...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #51:

score: 0
Accepted
time: 2ms
memory: 3408kb

input:

22 1500000
5 8 12 21 18 20 9 11 14 1 6 13 16 15 4 22 3 17 19 2 7 10

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #52:

score: 0
Accepted
time: 2ms
memory: 5704kb

input:

140 1500000
140 69 98 58 47 115 112 133 132 131 130 129 45 27 126 125 124 123 55 121 120 119 139 117 118 113 114 135 73 41 61 75 108 122 60 105 109 103 102 44 21 99 138 97 96 95 94 110 92 91 65 89 88 77 86 85 84 83 78 81 80 79 82 104 17 87 56 128 42 71 70 101 26 33 66 90 51 63 59 93 8 62 137 57 74 1...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #53:

score: 0
Accepted
time: 2ms
memory: 3648kb

input:

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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #54:

score: 0
Accepted
time: 2ms
memory: 3400kb

input:

5 1500000
2 3 5 4 1

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #55:

score: 0
Accepted
time: 2ms
memory: 3608kb

input:

149 1500000
55 115 8 146 145 144 143 116 41 140 70 103 137 87 135 17 43 76 21 130 110 128 62 39 125 28 123 122 51 120 61 72 142 96 148 114 75 90 59 89 56 108 107 64 34 117 47 63 101 52 99 98 97 141 95 94 26 104 44 119 1 88 37 86 85 66 136 82 81 100 57 78 68 132 124 74 73 118 134 112 9 5 67 131 65 13...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #56:

score: 0
Accepted
time: 2ms
memory: 3544kb

input:

136 1500000
77 120 3 11 34 121 63 81 9 10 4 57 13 14 15 16 35 18 19 104 21 22 28 62 98 8 27 60 52 30 31 32 33 103 17 117 54 99 128 72 42 41 82 44 1 46 47 48 49 50 51 40 53 37 73 56 12 58 39 108 61 24 100 135 65 125 67 68 66 70 71 96 55 136 75 23 80 7 79 45 26 123 6 84 85 86 102 88 110 90 91 92 93 11...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #57:

score: 0
Accepted
time: 2ms
memory: 3544kb

input:

25 1500000
13 14 20 17 19 10 5 2 23 15 18 24 3 22 21 16 6 8 9 11 1 12 25 7 4

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #58:

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

input:

145 1500000
1 86 3 25 5 6 4 97 39 10 11 138 13 117 15 16 51 136 131 20 21 22 23 27 139 26 94 105 119 30 31 32 50 79 143 57 34 38 135 54 40 145 33 44 134 46 42 48 49 43 129 7 81 41 87 28 76 98 59 60 61 62 63 68 65 77 67 55 29 102 71 126 85 74 93 47 72 114 37 64 83 82 128 84 73 112 80 88 89 92 91 90 1...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #59:

score: 0
Accepted
time: 2ms
memory: 3592kb

input:

121 1500000
37 18 3 49 48 6 105 90 4 121 113 12 13 14 35 16 95 86 10 62 76 22 23 26 25 24 27 39 15 63 31 80 69 34 29 36 81 11 32 101 40 42 44 20 45 89 114 17 9 50 51 97 87 82 58 56 57 118 59 60 120 53 30 64 112 66 41 109 33 117 47 72 96 88 38 54 84 5 1 8 100 65 83 106 85 2 21 115 46 75 91 92 93 94 7...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #60:

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

input:

24 1500000
18 24 16 4 11 6 15 2 21 20 1 23 17 7 13 9 10 8 19 5 3 22 14 12

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Subtask #4:

score: 16
Accepted

Dependency #3:

100%
Accepted

Test #61:

score: 16
Accepted
time: 4ms
memory: 4336kb

input:

938 15000000
683 133 390 701 819 645 533 742 83 579 864 53 457 762 203 727 489 497 610 46 895 162 307 44 498 526 511 684 801 513 364 486 269 656 826 931 458 189 178 890 286 34 756 875 150 928 636 855 394 786 220 837 353 799 848 191 387 422 14 669 30 708 348 459 868 148 49 707 694 520 611 267 110 264...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #62:

score: 0
Accepted
time: 2ms
memory: 6308kb

input:

723 15000000
264 42 584 245 417 36 191 318 548 172 512 333 29 547 467 136 490 275 79 413 123 148 392 43 338 343 258 472 622 717 435 188 252 516 448 217 1 428 279 300 720 468 260 721 659 85 427 362 266 699 662 129 635 449 285 203 613 186 384 647 707 395 633 353 175 115 639 58 443 493 290 155 220 102 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #63:

score: 0
Accepted
time: 5ms
memory: 4480kb

input:

998 15000000
597 257 921 428 380 684 476 611 36 336 675 682 305 185 505 800 433 973 23 459 287 662 219 466 43 680 659 155 251 63 141 30 757 499 390 240 992 924 704 323 841 824 825 847 351 651 716 894 603 28 92 85 616 391 322 24 384 168 118 429 759 578 857 791 442 379 218 430 91 708 96 902 281 274 8 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #64:

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

input:

329 15000000
101 298 227 5 12 60 212 145 67 105 241 2 267 91 323 317 95 39 262 279 289 233 133 46 272 196 195 160 144 131 114 318 164 201 307 225 246 325 112 102 34 98 94 28 158 1 51 78 36 222 140 141 174 54 146 84 169 295 243 82 306 297 73 128 260 75 74 135 234 239 58 193 142 299 21 4 326 254 263 1...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #65:

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

input:

359 15000000
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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #66:

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

input:

995 15000000
215 366 731 639 594 661 87 533 105 504 438 229 371 10 780 613 530 50 118 449 539 179 704 749 619 927 54 808 502 311 148 967 700 825 701 422 942 314 23 256 217 501 541 472 534 336 334 836 901 959 93 327 326 673 464 489 4 51 488 181 540 417 187 391 672 466 236 356 419 874 165 551 844 670 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #67:

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

input:

223 15000000
118 21 155 146 38 179 105 197 154 62 41 103 59 36 174 71 134 136 18 23 192 124 191 92 53 25 122 141 22 16 106 107 168 91 216 52 177 26 214 151 113 133 98 65 83 99 126 209 208 202 217 205 49 5 129 70 77 183 4 220 58 89 131 102 47 54 30 223 111 63 194 218 110 190 193 184 8 51 101 84 200 1...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #68:

score: 0
Accepted
time: 3ms
memory: 4320kb

input:

912 15000000
797 103 864 415 855 178 406 497 202 736 850 517 655 399 538 811 481 377 708 613 678 458 775 905 216 667 26 372 760 66 47 484 442 504 835 441 540 240 9 842 567 391 87 778 868 69 309 206 561 672 58 584 763 727 111 129 151 155 84 502 463 169 620 246 685 321 645 393 428 541 848 286 844 14 4...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #69:

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

input:

997 15000000
372 917 384 430 255 909 256 424 944 378 517 274 237 765 216 717 562 388 949 955 425 792 458 501 882 421 82 594 542 363 737 7 35 321 608 16 228 863 771 105 217 457 709 2 246 695 987 317 45 98 104 297 929 541 38 81 847 848 908 963 581 43 493 502 199 568 58 68 393 518 785 644 599 825 350 2...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #70:

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

input:

538 15000000
256 197 468 414 383 302 518 505 73 40 117 155 506 162 322 7 148 166 296 417 525 96 290 37 478 364 180 312 54 167 267 465 381 86 181 61 340 310 185 404 431 36 81 531 277 237 56 183 416 286 135 98 80 193 446 533 265 186 157 235 212 169 217 179 132 301 498 334 284 136 472 23 530 215 274 59...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #71:

score: 0
Accepted
time: 2ms
memory: 3828kb

input:

217 15000000
217 216 215 214 23 167 211 210 209 208 207 206 205 204 203 202 201 200 199 72 197 31 195 194 193 192 191 190 189 176 187 186 67 184 87 182 181 180 179 178 177 188 175 174 173 172 171 170 169 168 212 166 165 29 133 162 161 110 98 158 157 156 155 154 153 152 151 150 149 148 1 146 145 144 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #72:

score: 0
Accepted
time: 3ms
memory: 4024kb

input:

998 15000000
998 997 996 995 994 178 992 991 990 989 988 987 986 985 984 983 391 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 217 960 959 958 957 956 955 954 953 952 951 879 949 948 947 946 945 944 943 942 941 940 939 938 937 86 935 934 933 932 931 930 929 928 854 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #73:

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

input:

974 15000000
974 973 23 971 970 969 968 967 966 965 964 963 962 961 960 959 932 957 956 103 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 477 936 935 934 933 958 931 930 929 928 927 926 925 924 875 922 921 920 136 918 917 916 915 914 913 912 911 910 909 908 907 906 905 904 903 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #74:

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

input:

923 15000000
923 922 921 920 919 918 917 889 915 914 913 912 911 464 909 908 907 906 905 300 903 902 901 900 899 898 897 896 895 894 893 892 313 890 916 888 887 552 885 675 883 882 881 880 879 878 877 876 875 874 873 872 871 870 869 868 867 866 865 864 863 862 861 860 859 858 857 856 855 854 853 852...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #75:

score: 0
Accepted
time: 3ms
memory: 5912kb

input:

995 15000000
995 994 993 992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929 928 927 926 925 924...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #76:

score: 0
Accepted
time: 2ms
memory: 5496kb

input:

794 15000000
468 2 3 4 5 6 649 434 254 10 11 12 13 14 713 16 582 617 19 20 21 22 560 24 25 26 27 766 29 433 31 32 768 34 35 36 37 38 325 40 729 491 43 44 45 46 47 48 49 50 51 52 53 54 55 784 57 58 446 60 61 62 63 64 775 66 67 68 69 70 71 72 73 74 235 515 77 477 79 80 81 82 83 84 85 86 538 88 89 90 2...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #77:

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

input:

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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #78:

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

input:

993 15000000
1 2 3 4 5 6 7 939 9 10 11 12 650 211 15 16 17 18 139 20 21 317 23 24 371 488 27 28 29 30 31 32 33 34 35 36 37 38 39 40 891 42 43 44 45 46 47 48 49 50 411 52 198 54 55 116 57 58 59 64 61 62 63 60 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...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #79:

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

input:

658 15000000
1 2 3 4 5 6 7 484 9 569 11 12 13 181 529 16 17 18 19 20 336 335 23 24 25 26 27 28 29 30 31 32 254 34 35 36 129 38 39 40 92 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 647 58 59 97 61 62 63 64 387 66 67 68 69 70 71 72 512 472 75 76 77 78 79 80 81 82 294 84 85 86 87 627 89 90 91 41 93 94...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #80:

score: 0
Accepted
time: 2ms
memory: 3688kb

input:

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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Subtask #5:

score: 16
Accepted

Dependency #4:

100%
Accepted

Test #81:

score: 16
Accepted
time: 2ms
memory: 3572kb

input:

343 15000000
103 271 289 73 316 309 231 92 21 66 74 312 195 336 158 236 141 242 77 149 123 140 85 111 323 339 313 65 202 287 20 45 114 15 155 238 40 60 260 330 294 324 59 241 247 307 301 209 25 138 314 253 208 44 240 169 246 18 265 97 186 67 173 207 278 102 223 302 282 61 55 125 51 315 187 19 2 159 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #82:

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

input:

3957 15000000
3059 1745 2290 497 648 3162 3894 1 649 1188 103 979 3151 800 2727 860 3616 273 1144 3252 2278 459 1383 3879 489 389 515 2600 2038 1148 1368 2058 989 758 1525 1248 3867 132 2673 3427 973 1284 901 203 1108 3332 3426 3000 1211 2748 907 2888 1240 937 1303 2219 2796 114 275 589 1843 2316 22...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #83:

score: 0
Accepted
time: 20ms
memory: 13076kb

input:

4993 15000000
612 401 4036 23 3695 3646 331 3235 2949 828 916 2747 4251 2774 2471 3137 2205 4279 3124 857 4329 2073 2354 2792 1256 454 4973 4353 4702 1292 2913 4896 2699 2669 451 4527 3021 2493 539 3488 4579 457 2249 888 3144 1737 2566 3316 3440 1955 4581 2679 3684 3362 19 3294 4283 4431 265 829 267...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #84:

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

input:

4257 15000000
360 3658 3838 3387 3163 2614 36 2097 598 718 2445 494 3072 1478 2248 2981 1638 2951 3582 1510 1923 2314 444 2719 3006 1748 3125 1288 3364 2563 2058 4047 131 1704 1488 3304 2090 3634 3859 2353 3659 951 1567 1413 1206 546 219 1144 1639 1537 1467 3517 3200 1209 4164 2016 2720 705 4239 585...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #85:

score: 0
Accepted
time: 8ms
memory: 8432kb

input:

2719 15000000
1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #86:

score: 0
Accepted
time: 17ms
memory: 12268kb

input:

4992 15000000
2160 757 2280 4480 653 514 3660 2148 1022 2185 4156 1061 1417 4880 1596 319 2656 3178 4724 4197 1488 2888 901 565 2863 4109 2743 745 2190 531 4562 3220 2935 3966 808 3296 1390 2788 4167 736 3321 1519 2784 855 1641 291 3181 1676 3259 1878 3122 34 1113 4378 1282 2736 3927 1484 3064 3350 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #87:

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

input:

4317 15000000
1406 1519 466 3893 3477 677 3383 464 317 3146 4312 3757 349 1412 144 159 1399 531 3857 212 2347 794 2422 3306 1402 1626 1146 1866 2531 944 228 2663 3478 422 3838 2184 1320 3246 1039 2760 3218 3513 1313 1365 1988 559 1372 1590 2897 2115 1351 4021 3988 423 3147 3922 2573 586 3937 1053 32...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #88:

score: 0
Accepted
time: 11ms
memory: 12292kb

input:

4397 15000000
38 2073 4016 2929 780 931 1591 323 714 2764 1540 906 2479 3966 4011 2782 2748 1782 262 1428 1660 1095 54 1219 3811 2826 1374 678 1158 2910 3740 3438 1233 2330 2824 3679 3567 4207 2322 761 1954 2088 2967 3154 191 480 1079 587 3289 767 2094 865 500 748 2858 1193 2287 2165 3836 634 1808 3...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #89:

score: 0
Accepted
time: 8ms
memory: 13632kb

input:

4994 15000000
365 1985 1263 4590 3334 1170 1322 4767 3241 174 3871 3242 314 2265 3048 2906 1410 164 2339 4161 523 1580 49 2118 536 2403 3312 1780 2106 3665 3746 4854 2721 1867 2437 559 3406 3245 4010 3233 1789 4836 4209 1777 865 1009 1645 3822 4407 1054 2397 1477 1275 1915 2091 3657 249 3810 2828 17...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #90:

score: 0
Accepted
time: 10ms
memory: 12448kb

input:

3771 15000000
990 614 642 3648 3356 1373 1703 3373 1522 3760 1336 2039 517 1624 3472 3377 1650 255 2761 3009 1453 3127 1594 3289 585 2293 880 3514 1572 53 1128 1478 1402 1992 2913 3339 486 1801 888 628 1968 2829 2931 1800 315 647 3233 1455 776 1957 2845 121 1227 3529 2839 2679 392 1908 2393 3254 479...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #91:

score: 0
Accepted
time: 2ms
memory: 4348kb

input:

1109 15000000
1007 1082 45 246 434 5 873 214 118 884 940 1030 857 718 852 36 935 29 800 1107 811 519 1046 72 954 106 310 1051 88 1021 782 663 93 989 415 567 1041 1096 521 1106 229 739 738 355 71 702 941 84 429 965 300 472 74 992 886 741 618 267 334 596 994 1080 464 1025 918 481 167 597 1086 933 473 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #92:

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

input:

4990 15000000
1274 673 3734 2925 2785 149 2377 479 994 4397 449 1852 4373 4526 1281 1753 3725 1000 1250 1500 2176 4363 1229 4332 1140 4388 1402 4824 4168 3494 414 4957 1313 1502 4773 603 4254 269 3330 1095 4377 3936 3693 3609 3680 178 1005 3570 3372 2669 1692 3446 155 2250 2996 460 736 595 3740 914 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #93:

score: 0
Accepted
time: 11ms
memory: 12660kb

input:

4737 15000000
648 3405 2978 2974 4607 1510 694 2154 4474 743 1705 4304 2769 4340 2060 1782 223 4389 2130 4583 3834 3905 2417 3034 2125 1758 3752 3583 1766 2870 2575 1220 3270 3291 3896 191 272 4407 1928 4631 1537 4659 2702 1120 4183 2593 4367 3181 3120 1640 2810 2329 1650 279 4466 4251 3299 1175 177...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #94:

score: 0
Accepted
time: 2ms
memory: 3684kb

input:

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

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #95:

score: 0
Accepted
time: 10ms
memory: 13164kb

input:

4995 15000000
2070 987 1887 2102 4773 3100 320 4564 4457 1883 4473 3508 4887 164 3474 3433 1235 3448 4259 645 2495 686 1612 1149 3722 4214 2046 1262 4111 1502 29 3261 2487 1046 3311 122 3178 2714 4101 751 256 290 378 4719 4004 1187 1147 4164 458 633 1150 1808 1137 1111 98 696 1171 3283 57 2519 2939 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #96:

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

input:

1544 15000000
639 623 292 1286 1395 955 1012 1213 1195 831 824 1374 519 641 457 1163 1273 260 1245 330 676 398 41 785 982 313 122 924 1052 1218 1450 1156 1277 97 977 1434 1289 502 1096 1231 4 1166 1510 1407 1471 723 103 949 574 1345 1503 751 125 913 578 1203 506 979 812 865 228 272 35 635 883 1296 6...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #97:

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

input:

4257 15000000
4119 892 3507 380 2029 3033 3524 1607 3865 3100 751 1198 596 771 2430 511 671 745 2166 1839 1352 3369 4151 1670 2403 1875 2730 3946 2991 2448 943 760 1632 4212 1504 879 59 1745 3907 1996 2110 3934 2250 2841 2805 830 1482 136 2817 2124 1793 2839 1646 2850 3791 1238 1141 2351 3425 1283 4...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #98:

score: 0
Accepted
time: 22ms
memory: 12552kb

input:

4996 15000000
4695 979 233 763 4594 744 1271 1064 4235 2900 2634 227 4684 4881 2298 1870 625 769 2106 1763 3639 3189 4850 4615 960 834 3468 3426 2244 3093 4965 1489 138 3304 3733 2364 4422 1101 4586 1440 1494 2034 1745 2861 4465 3968 2362 2553 2371 1586 2811 1741 2843 3523 3023 2583 4754 4204 2770 1...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #99:

score: 0
Accepted
time: 2ms
memory: 3844kb

input:

835 15000000
21 2 3 4 5 6 7 8 9 10 593 12 13 520 255 16 228 18 547 757 247 22 23 24 791 26 27 28 815 30 31 32 33 734 35 36 37 38 39 627 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 699 58 59 816 267 62 63 64 601 460 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 789 83 670 85 86 87 423 89 90 528 92...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #100:

score: 0
Accepted
time: 5ms
memory: 7540kb

input:

1221 15000000
33 404 306 878 159 766 893 501 735 918 719 1136 378 571 284 826 171 1046 1121 915 654 1088 78 605 59 832 676 788 829 937 1187 1042 949 1153 565 584 942 34 570 269 1053 801 1185 1094 225 394 574 885 1071 616 877 1114 130 1201 503 94 1016 1135 156 462 205 902 592 117 683 235 498 1036 7 4...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Subtask #6:

score: 0
Wrong Answer

Dependency #5:

100%
Accepted

Test #101:

score: 30
Accepted
time: 220ms
memory: 148520kb

input:

51623 15000000
32129 7028 11059 38659 6996 30740 38217 17127 28185 4356 41286 44342 15644 46912 8994 5285 48092 36267 12962 13518 32064 45980 35934 34758 50213 43917 43421 46137 18764 15557 9119 4668 28759 49303 31649 30616 10689 40246 4999 46613 6206 46942 50173 23899 39906 14818 29273 47195 50869 ...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #102:

score: 0
Accepted
time: 45ms
memory: 39372kb

input:

14665 15000000
12169 9082 13020 10456 13197 1145 11331 9699 3207 3673 9669 4213 1005 7185 10464 13547 10857 3323 5606 1911 12216 6077 11574 4598 4351 6525 2726 4987 1851 632 4699 697 9561 782 3655 14175 10903 168 4688 2139 8024 6687 14139 11589 5551 10339 13330 6617 5190 7231 4820 6474 12948 6606 71...

output:

Correct Answer :) Congrats!

result:

ok 4 tokens

Test #103:

score: -30
Wrong Answer
time: 377ms
memory: 292916kb

input:

99999 15000000
5129 40709 78176 39527 86783 60640 6093 74504 33511 73268 50451 71197 70780 42392 53057 49907 2543 61492 2743 20789 86582 19062 51131 79916 68367 82963 77618 22359 47903 65571 89380 45724 87200 99939 91323 4535 37928 20349 92524 37036 67728 81245 20745 35884 60737 34894 88427 95647 26...

output:

Too many operations

result:

wrong answer 1st words differ - expected: 'Correct', found: 'Too'