QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#424695#5022. 【模板】线段树fzj200744 1241ms6316kbC++142.3kb2024-05-29 15:32:412024-05-29 15:32:41

Judging History

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

  • [2024-05-29 15:32:41]
  • 评测
  • 测评结果:44
  • 用时:1241ms
  • 内存:6316kb
  • [2024-05-29 15:32:41]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
template<typename T>inline void read(T &x){
	x=0;
	bool flag=0;
	char ch=getchar();
	while(ch<'0'||ch>'9') flag=flag||(ch=='-'),ch=getchar();
	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	x=flag?-x:x;
}
template<typename T,typename ...Args>inline void read(T &x,Args &...args){
	read(x),read(args...);
}
template<typename T>inline void prt(T x){
	if(x>9) prt(x/10);
	putchar(x%10+'0');
}
template<typename T>inline void put(T x){
	if(x<0) putchar('-'),x=-x;
	prt(x);
}
template<typename T>inline void put(char ch,T x){
	put(x),putchar(ch);
}
template<typename T,typename ...Args>inline void put(char ch,T x,Args ...args){
	put(ch,x),put(ch,args...);
}
#define N 250005
int id,n,q,w[N];
namespace Solve1{
	inline void solve(){
		for(int i=1,op,l,r;i<=q;i++){
			read(op);
			if(op==1){
				read(l,r);
				for(int j=r;j>l;j--) w[j]^=w[j-1];
			}else{
				read(l);
				put('\n',w[l]);
			}
		}
		for(int i=1;i<=n;i++) put('\n',w[i]);
	}
}
namespace Solve3{
	inline bitset<N> range(bitset<N> s,int l,int r){
		s>>=l;
		s<<=(l+N-r-1);
		s>>=(N-r-1);
		return s;
	}
	inline void solve(){
		bitset<N> s;
		if(id==2) s[1]=1;
		else{
			for(int i=1;i<=n;i++) s[i]=w[i];
		}
		for(int i=1,op,l,r;i<=q;i++){
			read(op);
			if(op==1){
				read(l,r);
				s^=range(s,l,r-1)<<1;
			}else{
				read(l);
				if(id==2) put('\n',s[l]?w[1]:0);
				else put('\n',s[l]);
			}
		}
		for(int i=1;i<=n;i++) 
			if(id==2) put('\n',s[i]?w[1]:0);
			else put('\n',s[i]);
	}
}
namespace Solved{
	int tmp[N];
	vector<int> vec;
	inline void solve(){
		int tim=0;
		for(int i=1;i<=n;i++)
			if(w[i]) vec.emplace_back(i); 
		for(int i=1,op,l,r;i<=q;i++){
			read(op);
			if(op==1) read(l,r),tim++;
			else{
				read(l);
				int res=0;
				for(auto v:vec){
					if(v>l) continue;
					if((tim&(l-v))==(l-v)) res^=w[v];
				}
				put('\n',res);
			}
		}
		for(int k=17;~k;k--){
			if(!(tim>>k&1)) continue;
			for(int i=1;i<=n;i++)
				tmp[i]=w[i]^(i-(1<<k)>0?w[i-(1<<k)]:0);
			for(int i=1;i<=n;i++) w[i]=tmp[i];
		}
		for(int i=1;i<=n;i++) put('\n',w[i]);
	}
}
int main(){
	read(id,n,q);
	for(int i=1;i<=n;i++) read(w[i]);
	if(id==1) return Solve1::solve(),0;
	if(id==2||id==3) return Solve3::solve(),0;
	if(id==4||id==5||id==6) return Solved::solve(),0;
	
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 8
Accepted

Test #1:

score: 8
Accepted
time: 1ms
memory: 3732kb

input:

1
6 6
1 1 5 1 9 4
2 5
1 2 5
2 4
1 3 6
2 6
1 1 6

output:

9
4
12
1
0
5
4
12
0

result:

ok 9 numbers

Test #2:

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

input:

1
999 997
898798734 979577086 45974352 1013270193 1053191143 533594258 372426673 947830633 122319874 368651315 866424479 109724831 427664962 558099346 764830489 326451620 322471751 525780385 746941281 670254345 586958579 979544209 743892216 436404384 291681381 979530194 998929567 367716728 909076993...

output:

1015342581
962986689
965094083
871356796
835210392
172023195
63088572
606096781
569607283
436055720
154605892
663158209
154605892
776365236
281312240
62398687
182713417
604764772
816533315
793514230
325061861
806973284
91749226
283750235
198953311
170342298
432592070
809908556
683302450
40932811
669...

result:

ok 1996 numbers

Test #3:

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

input:

1
999 997
89872218 906651903 120274311 490547919 291584020 755757065 24942887 707247173 763024744 68250332 114193028 999245166 140381610 171802205 399965713 299821903 907998064 906075056 427270276 335420206 708713870 492555323 359637714 197212814 35225369 1011322274 912003632 633998134 1026276199 85...

output:

89872218
860962725
120274311
490547919
978745892
924706625
610771729
524956121
105748312
139294727
866385688
729638611
92178006
1037482711
80194776
277477501
592738191
694314356
733017733
701758468
65199929
983529101
717179143
542164040
444291361
439952700
147939819
276321083
1012586084
166061298
30...

result:

ok 999 numbers

Test #4:

score: 8
Accepted
time: 1ms
memory: 3668kb

input:

1
998 997
802301789 913975794 256883306 462593698 958614999 708264636 114045898 622336472 273146091 1035403087 151608039 853195969 670449389 1967248 347890740 88419426 272759411 668812195 315110503 54515201 11283025 183682542 149656693 916299553 345162140 626592021 633508243 201443721 191882154 4200...

output:

654798390
720797824
232736065
90537128
467468783
391542471
410387328
970043816
199400953
691327788
183682542
543340459
435746483
305146388
967107550
72899382
419833683
273367829
1062016570
511549763
893866015
137019003
177123936
524992882
462306449
1057090504
72525968
344810664
332588248
94524245
57...

result:

ok 1491 numbers

Test #5:

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

input:

1
10 64
178 181 183 184 188 189 190 191 192 195
1 3 5
2 10
2 8
1 4 9
2 10
2 2
1 1 5
2 5
2 3
2 3
1 2 7
2 3
1 3 9
2 7
1 1 8
1 2 8
2 7
2 7
2 5
2 2
2 7
2 5
1 2 7
1 8 10
1 2 3
1 6 10
1 5 6
1 5 7
2 4
1 5 10
1 2 5
2 3
1 4 7
2 5
1 2 10
1 3 10
1 2 5
2 3
1 1 3
1 2 7
2 10
1 2 9
2 4
1 2 6
2 10
1 4 6
1 2 9
2 4
2...

output:

195
191
195
181
4
2
2
5
7
1
1
3
181
1
3
15
2
12
2
6
189
6
186
7
9
6
125
13
13
189
189
183
178
181
183
10
4
14
189
179
122
6

result:

ok 42 numbers

Subtask #2:

score: 4
Accepted

Test #6:

score: 4
Accepted
time: 581ms
memory: 4784kb

input:

2
249998 99999
1048488450 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 300080 numbers

Test #7:

score: 4
Accepted
time: 1152ms
memory: 4732kb

input:

2
249999 100000
734489692 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 259044 numbers

Test #8:

score: 4
Accepted
time: 290ms
memory: 4728kb

input:

2
249996 99997
379291425 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 325012 numbers

Test #9:

score: 4
Accepted
time: 1241ms
memory: 4788kb

input:

2
249997 99998
713646381 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

0
0
0
713646381
0
713646381
0
0
0
0
0
0
713646381
713646381
713646381
713646381
0
0
0
713646381
0
713646381
713646381
713646381
0
0
713646381
0
713646381
713646381
713646381
713646381
0
713646381
713646381
713646381
0
0
713646381
0
713646381
713646381
0
713646381
713646381
0
0
713646381
0
0
0
0
0
0
...

result:

ok 250982 numbers

Subtask #3:

score: 7
Accepted

Test #10:

score: 7
Accepted
time: 542ms
memory: 4800kb

input:

3
250000 99999
1 1 1 1 1 0 1 0 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 0 1 1 1 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0 1 0 1 0 0 1 0 0 1 1 1 0 0 0 1 1 1 1 1 1 0 0 1 1 1 1 0 0 0 0 1 1 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 1 1 0 1 0 1 0 0 1 0 1 1 1 0 1 1 0 1 1 0 1 0 0 1 1...

output:

0
0
0
0
1
0
1
0
0
0
0
0
1
0
0
1
0
0
0
0
1
1
0
1
1
0
1
0
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
0
1
0
0
0
1
1
0
1
0
0
1
1
0
1
0
0
0
0
1
1
1
0
1
1
0
0
0
1
1
0
1
0
1
1
0
1
0
1
1
0
1
1
0
0
1
0
1
0
1
0
1
1
1
1
0
0
0
1
1
0
0
0
1
1
1
0
1
1
1
1
1
0
1
0
1
1
0
1
1
1
0
0
1
1
1
0
0
0
1
0
1
1
1
1
1
1
0
1
1
1
1
1
0
1
1
0
...

result:

ok 300215 numbers

Test #11:

score: 7
Accepted
time: 1166ms
memory: 4792kb

input:

3
249996 100000
1 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0 1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 0 1 0 0 1 1 0 1 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 1 1 0 1 1 0 0 0 1 0 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 0 1 1 0 0 1 1 1 1 ...

output:

0
1
0
1
0
0
1
0
1
0
1
1
1
0
0
0
0
0
1
0
0
0
0
1
0
0
1
1
1
0
1
0
1
0
0
1
0
0
1
1
1
0
0
1
0
1
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
0
0
0
0
1
0
1
1
1
0
1
1
1
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
0
0
1
0
1
0
0
0
0
1
1
0
1
1
1
0
0
1
0
0
1
0
1
1
1
1
0
1
0
0
1
1
0
0
0
0
0
1
1
0
0
1
...

result:

ok 258845 numbers

Test #12:

score: 7
Accepted
time: 996ms
memory: 4868kb

input:

3
249998 100000
0 1 0 1 1 0 1 0 1 0 1 0 1 0 0 1 1 0 0 0 1 0 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 1 1 1 0 0 0 0 0 1 1 1 1 1 0 1 1 1 0 1 1 0 1 1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 0 0 1 0 0 1 0 1 1 1 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 0 0 0 1 0 ...

output:

0
1
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
1
0
0
1
0
0
1
0
0
0
1
0
0
0
0
0
1
1
1
0
1
0
0
1
1
1
0
1
1
1
0
0
1
0
1
1
1
0
0
1
1
1
0
1
0
0
1
1
1
1
1
0
1
0
1
0
0
1
1
0
0
1
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
1
1
1
0
0
1
1
1
0
1
0
1
1
1
0
0
1
1
1
1
0
1
1
1
1
1
0
1
0
0
1
0
1
0
1
0
1
1
1
1
0
1
0
1
1
1
0
1
1
1
1
1
0
...

result:

ok 259148 numbers

Test #13:

score: 7
Accepted
time: 100ms
memory: 4800kb

input:

3
249996 100000
1 0 0 0 1 1 1 0 0 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 1 0 0 1 0 0 0 1 1 1 1 0 0 0 0 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 0 1 1 1 0 0 1 1 0 1 0 0 1 1 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 0 0 1 1 0 0 1 0 0 1 0 0 1 0 0 1 1 0 1 1 1 0 0 ...

output:

0
1
1
1
0
1
0
1
1
0
1
1
0
1
0
0
0
1
0
1
1
0
1
0
0
0
0
1
1
0
0
0
0
1
1
1
1
0
1
1
1
0
0
1
0
1
1
0
1
1
0
0
0
1
1
1
1
1
0
0
0
1
0
0
1
0
1
0
0
1
1
0
1
0
1
0
1
0
1
1
1
0
1
1
0
0
0
1
0
1
1
0
0
0
1
1
1
0
0
1
0
1
1
1
0
0
0
1
1
0
0
1
0
1
1
1
0
1
0
1
1
1
0
0
0
0
1
1
0
0
0
0
1
1
0
1
1
1
1
0
0
1
1
0
0
1
0
1
1
1
...

result:

ok 341048 numbers

Subtask #4:

score: 13
Accepted

Test #14:

score: 13
Accepted
time: 16ms
memory: 5624kb

input:

4
249996 99997
309331355 195839266 912372930 57974187 363345291 954954162 650621300 389049294 821214285 263720748 231045308 844370953 768579771 664766522 681320982 124177317 32442094 297873605 743179832 1073656106 443742270 235746807 1054294813 974443618 422427461 307448375 1018255356 20105813 36821...

output:

611117059
866091251
300188933
0
478915924
1053588351
453142424
897441996
60971719
748656483
600408393
0
303761852
983037069
883016404
332332552
1069626159
860304528
851235295
561276840
389049294
681320982
484263000
351914192
620106464
667080579
733146026
375466744
0
347632358
737240082
321494160
0
3...

result:

ok 299980 numbers

Test #15:

score: 13
Accepted
time: 14ms
memory: 5616kb

input:

4
249996 99997
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
707358968
0
0
0
165359261
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
301087804
0
0
0
0
...

result:

ok 348991 numbers

Test #16:

score: 13
Accepted
time: 7ms
memory: 5612kb

input:

4
249996 100000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

0
0
0
0
0
0
0
0
412012733
460047966
0
0
0
94984489
0
0
0
0
1010860949
0
0
0
336953687
0
0
0
0
0
655564155
25780913
662736870
0
0
0
0
0
679917886
0
998313118
0
0
0
0
0
171168202
20014081
336953687
0
0
0
0
1018313742
0
997397452
0
849015355
0
16108473
0
0
0
504340154
0
397006673
0
0
0
0
0
0
290851883
...

result:

ok 250950 numbers

Test #17:

score: 13
Accepted
time: 16ms
memory: 5628kb

input:

4
249999 99998
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
956381802
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1021925694
922314342
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

result:

ok 300062 numbers

Subtask #5:

score: 12
Accepted

Test #18:

score: 12
Accepted
time: 21ms
memory: 6196kb

input:

5
249997 99997
860563869 428592873 58576739 761578583 47999879 294581118 988847649 569566599 640106250 440172702 178219106 966598261 763325707 846927552 877923116 145156535 246778542 25949847 507939778 116507169 555239769 259969305 328955819 171606729 535970481 121608060 4437163 370976515 713807003 ...

output:

860563869
717285236
452329866
773393204
485721677
965902221
831024341
890990738
455498944
92913689
556500009
102303365
264515518
445496274
654612933
988537886
165104807
364103659
952755344
576499197
775866335
1003839403
606880290
1006459039
1005979559
588810854
592470517
765610807
123827263
86327854...

result:

ok 249997 numbers

Test #19:

score: 12
Accepted
time: 23ms
memory: 6316kb

input:

5
249998 100000
1055401468 532211763 131695513 214363867 831955115 452049333 729606869 69161863 428100767 90941242 729034740 90774107 332674212 930394013 601735907 104187221 1017052616 31513597 868964816 1054507185 926990168 75998133 1039482150 781325037 680316641 471310435 780674964 330142918 10271...

output:

1055401468
532211763
131695513
214363867
831955115
452049333
729606869
69161863
428100767
90941242
729034740
90774107
332674212
930394013
601735907
104187221
1017052616
31513597
868964816
1054507185
926990168
75998133
1039482150
781325037
680316641
471310435
780674964
330142918
1027184688
750941669
...

result:

ok 249998 numbers

Test #20:

score: 12
Accepted
time: 21ms
memory: 6248kb

input:

5
249999 65535
206222027 1038492265 248834236 84032585 981309757 273118313 589015947 1002433231 482381717 342803573 48417408 196676553 50772773 199061806 637191822 974252922 289297532 48985206 415073252 593023329 9193325 632026989 55397875 918843456 476033799 664362612 383124333 926156312 133237149 ...

output:

206222027
833392802
1064859678
981091415
515434
272673027
861602440
149219399
337930194
4891559
44591399
152134382
169335243
30058725
607153771
505513233
253743469
234136859
357115647
907147166
916304115
322324382
276499053
650082861
987810090
494507870
196056115
1016828459
996842422
602075803
53081...

result:

ok 249999 numbers

Subtask #6:

score: 0
Time Limit Exceeded

Dependency #5:

100%
Accepted

Test #21:

score: 0
Time Limit Exceeded

input:

6
249999 99998
234899190 294042590 622374272 592723113 719234312 350081074 842293736 684699037 330659123 145765638 707972395 212219898 665588169 1002656251 377046330 569400576 515159132 246671859 367313733 436193585 1056439739 889727758 441186237 802117710 672761337 1013893805 760105556 959623512 10...

output:

416342969
682608684
897388094
564167584
723521403
277032360
571217154
804968920
345689708
20430886
2669323
397914023
682539746
743678615
902811241
79705781
117866215
29290630
463835109
948618157
996425135
333840809
879030503
756069154
651860206
62844241
563208222
473841643
306068071
945671265
755499...

result:


Subtask #7:

score: 0
Wrong Answer

Dependency #5:

100%
Accepted

Test #28:

score: 0
Wrong Answer
time: 7ms
memory: 4636kb

input:

7
249999 99998
1028875149 290751586 85260062 527433830 11253389 381520904 163374626 882045937 328797576 362761070 107207247 721987314 848366187 492948114 913994419 980121735 553555299 238308272 517289115 493658637 535863518 18389830 59694996 328276770 970756488 409396240 782649706 568544673 92874299...

output:


result:

wrong answer Answer contains longer sequence [length = 249999], but output contains 0 elements

Subtask #8:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

0%