QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#620699#7441. rpxleqxqN_z_100 ✓730ms75128kbC++208.0kb2024-10-07 20:30:122024-10-07 20:30:18

Judging History

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

  • [2024-10-07 20:30:18]
  • 评测
  • 测评结果:100
  • 用时:730ms
  • 内存:75128kb
  • [2024-10-07 20:30:12]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
struct time_helper{
#ifdef LOCAL
clock_t time_last;time_helper(){time_last=clock();}void test(){auto time_now=clock();std::cerr<<"time:"<<1.*(time_now-time_last)/CLOCKS_PER_SEC<<";all_time:"<<1.*time_now/CLOCKS_PER_SEC<<std::endl;time_last=time_now;}~time_helper(){test();}
#else
void test(){}
#endif
}time_helper;
#ifdef LOCAL
#include"dbg.h"
#else
#define dbg(...) (__VA_ARGS__)
#endif
namespace Fread{const int SIZE=1<<16;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++;}}namespace Fwrite{const int SIZE=1<<16;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;}
#define getchar Fread::getchar
#define putchar Fwrite::putchar
int print_precision=10;bool print_T_endl=1;char print_between=' ';
template<typename T>struct is_char{static constexpr bool value=(std::is_same<T,char>::value||std::is_same<T,signed char>::value||std::is_same<T,unsigned char>::value);};template<typename T>struct is_integral_ex{static constexpr bool value=(std::is_integral<T>::value||std::is_same<T,__int128>::value)&&!is_char<T>::value;};template<typename T>struct is_floating_point_ex{static constexpr bool value=std::is_floating_point<T>::value||std::is_same<T,__float128>::value;};namespace Fastio{struct Reader;struct Writer;template<size_t id>struct read_tuple{template<typename...T>static void read(Reader&stream,std::tuple<T...>&x){read_tuple<id-1>::read(stream,x);stream>>get<id-1>(x);}};template<>struct read_tuple<0>{template<typename...T>static void read([[maybe_unused]]Reader&stream,[[maybe_unused]]std::tuple<T...>&x){}};template<size_t id>struct print_tuple{template<typename...T>static void print(Writer&stream,const std::tuple<T...>&x){print_tuple<id-1>::print(stream,x);putchar(print_between);stream<<get<id-1>(x);}};template<>struct print_tuple<1>{template<typename...T>static void print(Writer&stream,const std::tuple<T...>&x){stream<<get<0>(x);}};template<>struct print_tuple<0>{template<typename...T>static void print([[maybe_unused]]Writer&stream,[[maybe_unused]]const std::tuple<T...>&x){}};
struct Reader{template<typename T>typename std::enable_if_t<std::is_class<T>::value,Reader&>operator>>(T&x){for(auto &y:x)*this>>y;return *this;}template<typename...T>Reader&operator>>(std::tuple<T...>&x){read_tuple<sizeof...(T)>::read(*this,x);return *this;}template<typename T>typename std::enable_if_t<is_integral_ex<T>::value,Reader&>operator>>(T&x){char c=getchar();short f=1;while(c<'0'||c>'9'){if(c=='-')f*=-1;c=getchar();}x=0;while(c>='0'&&c<='9'){x=(x<<1)+(x<<3)+(c^48);c=getchar();}x*=f;return *this;}template<typename T>typename std::enable_if_t<is_floating_point_ex<T>::value,Reader&>operator>>(T&x){char c=getchar();short f=1,s=0;x=0;T t=0;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 return x*=f,*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;}template<typename T>typename std::enable_if_t<is_char<T>::value,Reader&>operator>>(T&c){c=getchar();while(c=='\n'||c==' '||c=='\r')c=getchar();return *this;}Reader&operator>>(char*str){int len=0;char c=getchar();while(c=='\n'||c==' '||c=='\r')c=getchar();while(c!='\n'&&c!=' '&&c!='\r')str[len++]=c,c=getchar();str[len]='\0';return*this;}template<typename T1,typename T2>Reader&operator>>(std::pair<T1,T2>&x){*this>>x.first>>x.second;return *this;}Reader&operator>>(std::string&str){str.clear();char c=getchar();while(c=='\n'||c==' '||c=='\r')c=getchar();while(c!='\n'&&c!=' '&&c!='\r')str.push_back(c),c=getchar();return*this;}Reader(){}}cin;const char endl='\n';
struct Writer{typedef __int128 mxdouble;template<typename T>typename std::enable_if_t<std::is_class<T>::value,Writer&>operator<<(const T&x){for(auto q:x){*this<<q;if(!is_class<decltype(q)>::value)*this<<print_between;}if(!is_class<typename T::value_type>::value&&print_T_endl)*this<<'\n';return *this;}template<typename...T>Writer&operator<<(const std::tuple<T...>&x){print_tuple<sizeof...(T)>::print(*this,x);if(print_T_endl)*this<<'\n';return *this;}template<typename T>typename std::enable_if_t<is_integral_ex<T>::value,Writer&>operator<<(T x){if(x==0)return putchar('0'),*this;if(x<0)putchar('-'),x=-x;static int sta[45];int top=0;while(x)sta[++top]=x%10,x/=10;while(top)putchar(sta[top]+'0'),--top;return*this;}template<typename T>typename std::enable_if_t<is_floating_point_ex<T>::value,Writer&>operator<<(T x){if(x<0)putchar('-'),x=-x;x+=pow(10,-print_precision)/2;mxdouble _=x;x-=(T)_;static int sta[45];int top=0;while(_)sta[++top]=_%10,_/=10;if(!top)putchar('0');while(top)putchar(sta[top]+'0'),--top;putchar('.');for(int i=0;i<print_precision;i++)x*=10;_=x;while(_)sta[++top]=_%10,_/=10;for(int i=0;i<print_precision-top;i++)putchar('0');while(top)putchar(sta[top]+'0'),--top;return*this;}template<typename T>typename std::enable_if_t<is_char<T>::value,Writer&>operator<<(const T&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;}template<typename T1,typename T2>Writer&operator<<(const std::pair<T1,T2>&x){*this<<x.first<<print_between<<x.second;if(print_T_endl)*this<<'\n';return *this;}Writer&operator<<(const std::string&str){int st=0,ed=str.size();while(st<ed)putchar(str[st++]);return*this;}Writer(){}}cout;}
#define cin Fastio::cin
#define cout Fastio::cout
#define endl Fastio::endl
template<class Fun>class y_combinator_result{Fun fun_;public:template<class T>explicit y_combinator_result(T &&fun): fun_(std::forward<T>(fun)) {}template<class ...Args>decltype(auto) operator()(Args &&...args){return fun_(std::ref(*this), std::forward<Args>(args)...);}};template<class Fun>decltype(auto) y_combinator(Fun &&fun){return y_combinator_result<std::decay_t<Fun>>(std::forward<Fun>(fun));}

void init();void solve(int tc);
main()
{
    init();int t=1;
    // cin>>t;
    for(int tc=1;tc<=t;tc++)solve(tc);
}
void init()
{
}
constexpr int N=1000000,B=200;
int a[N+1];
long long ans[N+1],pre[N+1];
vector<tuple<int,int,int>>querys;
vector<tuple<int,int,int>>v[N+1];
bool cmp(const tuple<int,int,int>&a1,const tuple<int,int,int>&a2)
{
	auto [l1,r1,t1]=a1;
	auto [l2,r2,t2]=a2;
	return (l1/B==l2/B)?(l1/B)&1?r1<r2:r1>r2:l1<l2;
}
int up[1<<12],up2[1<<6],val[1<<18],k;
int query(int v)
{
    return up2[v>>12]+up[v>>6]+val[v];
}
void add(int v)
{
    for(int x=17;x>=12;x--)
    if(k>>x&1)
    {
        int l=(v^k^(1<<x))&~((1<<x)-1),r=l+(1<<x)-1;
        for(int y=l;y<r+1;y+=1<<12)up2[y>>12]++;
    }
    for(int x=11;x>=6;x--)
    if(k>>x&1)
    {
        int l=(v^k^(1<<x))&~((1<<x)-1),r=l+(1<<x)-1;
        for(int y=l;y<r+1;y+=1<<6)up[y>>6]++;
    }
    for(int x=5;x>=0;x--)
    if(k>>x&1)
    {
        int l=(v^k^(1<<x))&~((1<<x)-1),r=l+(1<<x)-1;
        for(int y=l;y<r+1;y++)val[y]++;
    }
}
void solve([[maybe_unused]]int tc)
{
	int n;
	cin>>n>>k;
    k++;
	for(int x=1;x<=n;x++)
	cin>>a[x],pre[x]=pre[x-1]+query(a[x]),add(a[x]);
    int m;
    cin>>m;
	for(int x=1;x<=m;x++)
	{
		int l,r;
		cin>>l>>r;
		querys.emplace_back(l,r,x);
	}
	sort(querys.begin(),querys.end(),cmp);
	int l=1,r=0;
	for(auto [L,R,t]:querys)
	{
		if(r<R)v[l-1].emplace_back(r+1,R,-t),ans[t]+=pre[R]-pre[r],r=R;
		if(l<L)v[r].emplace_back(l,L-1,-t),ans[t]+=pre[L-1]-pre[l-1]+L-l,l=L;
		if(r>R)v[l-1].emplace_back(R+1,r,t),ans[t]-=pre[r]-pre[R],r=R;
		if(l>L)v[r].emplace_back(L,l-1,t),ans[t]-=pre[l-1]-pre[L-1]+l-L,l=L;
	}
    memset(up2,0,sizeof(up2));
    memset(up,0,sizeof(up));
    memset(val,0,sizeof(val));
    for(int x=1;x<=n;x++)
    {
        add(a[x]);
        for(auto [L,R,t]:v[x])
        {
            long long sum=0;
            for(int y=L;y<=R;y++)
            sum+=query(a[y]);
            ans[abs(t)]+=(t>0?1:-1)*sum;
        }
    }
	long long lst=0;
	for(auto [L,R,t]:querys)
	ans[t]+=lst,lst=ans[t];
	for(int x=1;x<=m;x++)
	cout<<ans[x]<<endl;
}

詳細信息

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 2ms
memory: 8808kb

input:

11 4
11 4 5 1 4 1 9 1 9 8 10
5
1 4
1 9
1 9
8 10
8 10

output:

2
12
12
1
1

result:

ok 5 number(s): "2 12 12 1 1"

Subtask #2:

score: 19
Accepted

Dependency #1:

100%
Accepted

Test #2:

score: 19
Accepted
time: 0ms
memory: 8748kb

input:

100 9878
6695 25377 5727 9878 15055 10108 15771 7736 11554 24853 2650 18844 31573 30110 32407 18847 3680 1922 23329 9122 16047 5063 22001 28302 23835 10041 2747 20756 18458 28357 22979 13626 24882 10019 10482 21779 30388 12216 15145 1229 30118 17594 4565 24050 30721 9365 3268 12263 797 9357 15415 22...

output:

0
13
848
2
919
336
593
138
801
9
110
388
494
406
13
22
972
81
138
198
3
196
84
20
12
17
167
79
32
223
147
15
110
62
7
233
49
242
829
21
599
62
28
51
801
194
639
198
869
15
6
174
133
27
269
40
493
672
29
554
242
27
534
452
295
851
16
1024
6
10
13
254
34
1038
206
181
25
437
300
66
906
299
8
870
877
22...

result:

ok 100 numbers

Subtask #3:

score: 19
Accepted

Dependency #2:

100%
Accepted

Test #3:

score: 19
Accepted
time: 0ms
memory: 8960kb

input:

1000 9957
2513 28133 26190 28051 10992 19271 11053 10798 27840 21303 3707 25889 2701 5666 22537 7119 19901 13091 30865 20950 27142 4971 26512 18325 27102 29926 4947 31212 16179 2076 5973 20290 19549 9557 11464 5581 31057 23808 2418 14093 10519 26453 8378 17562 9086 14138 31491 16928 18190 13411 5944...

output:

5811
50434
18691
129275
68076
5681
6393
7664
752
66954
825
6005
13135
26931
42
26306
66115
74911
36700
1019
20906
518
4119
458
3183
97459
9935
318
1704
4573
4635
662
1751
64636
35584
11197
70049
19023
35287
3242
1689
148660
7244
6256
30381
4042
20754
6925
70254
67439
70311
30481
7405
10562
2809
36
1...

result:

ok 1000 numbers

Subtask #4:

score: 19
Accepted

Dependency #2:

100%
Accepted

Test #4:

score: 19
Accepted
time: 25ms
memory: 12608kb

input:

200000 26351
29455 31132 8794 31579 7515 31811 27905 7641 16326 17298 9898 28764 16137 423 22542 15235 22739 30407 5230 2403 25465 582 22239 23942 13801 15015 18918 11827 19425 20741 11588 752 31326 17330 19987 23622 18518 9245 17682 18628 16297 29689 28478 19271 19030 23963 21666 30328 28650 19364 ...

output:

9361396748
1282814907
5283887041
2104601125
171585368
20114278
907377643
13075864637
1205544902
2360788660
9725156
2338173533
2389637247
1728248740
164441959
3970397011
1949288839
1787769746
4740203220
4664717298
2505976221
8774292134
2384946005
723950727
709280821
3151818739
3296906354
1054674256
4...

result:

ok 100 numbers

Subtask #5:

score: 19
Accepted

Test #5:

score: 19
Accepted
time: 543ms
memory: 71300kb

input:

200000 50
4 83 4 57 16 32 21 19 19 30 10 84 62 10 21 59 14 72 60 38 90 26 23 4 10 59 43 1 82 9 94 27 3 58 12 8 54 97 30 74 63 44 15 22 17 20 45 100 55 3 65 23 18 53 53 4 28 90 1 31 88 15 64 42 3 83 12 84 19 8 56 85 49 6 57 97 97 22 59 14 64 3 22 17 61 22 92 79 5 88 53 20 83 13 28 85 28 77 44 19 1 85...

output:

342347193
3918487806
1098814786
7003746862
72779355
32360398
4530344679
266647718
3841941114
946930359
21266954
7279534560
1482071423
292723
46867973
23603825
2714047129
798221669
89070258
53455663
1362445792
2039836965
6029356229
1090134969
4419822
302048676
92087776
1221223257
131418477
4377202197...

result:

ok 1000000 numbers

Subtask #6:

score: 23
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #6:

score: 23
Accepted
time: 667ms
memory: 73200kb

input:

199990 60996
104341 31473 36131 88389 109087 8777 6124 164669 176773 166092 187866 173135 123744 35822 120107 140457 93581 129662 198977 6500 184713 7874 44964 194149 84193 65268 105309 126794 156919 16490 169019 101825 111019 9023 57399 118523 82427 71552 167427 192433 72856 61008 29189 152764 5099...

output:

202538205
2724322068
2543172559
52155149
4873420466
110147199
642169573
403053967
5277028
13146208
191090921
725133298
768379460
37406661
586331
431086464
1250237489
2823548786
488179460
111147438
873456985
501855196
2189168662
161783057
270739453
138339563
5891357
1938474064
3386813713
3526225364
2...

result:

ok 999961 numbers

Test #7:

score: 23
Accepted
time: 730ms
memory: 73356kb

input:

199974 137009
129687 91238 16888 54079 75299 18677 169846 113559 153831 134692 22118 66235 3859 197960 6321 148021 62759 142617 62019 149633 16149 133080 177317 107211 181774 179959 53897 124837 153161 171189 133875 64517 162847 4901 128620 4686 172652 68738 78877 90596 181723 47311 138768 197844 10...

output:

40426163
439615078
15157909
182849626
82421023
462064784
57069953
8859472064
750714398
78582675
3357401921
1584803415
1753312301
35297883
7077760815
736776237
3098900660
638908534
130283880
214294567
6556462973
964398789
108141306
60015
226508025
2160954669
2097502618
224226553
1612872105
2413719833...

result:

ok 999981 numbers

Test #8:

score: 23
Accepted
time: 680ms
memory: 71924kb

input:

199990 160495
17814 91966 22065 20265 22572 138410 72735 83099 122772 127539 108550 61110 23813 144427 181352 29902 194806 48960 29411 39862 46473 42904 75294 28150 50992 47064 121123 150583 30460 45456 74604 8286 165829 128772 155497 11987 166938 102858 199390 199789 22195 136932 105398 60488 11991...

output:

840617234
2926030159
2588075358
3833496734
4307888897
698948735
86531929
1422667856
5903836
4252792145
533291655
2833054440
964761679
200965955
3654953292
204118093
7213266250
7535086069
4706585253
710741773
61010832
256263459
128486383
352618742
1462031206
10032949869
123370819
3426945143
838546309...

result:

ok 999978 numbers

Test #9:

score: 23
Accepted
time: 651ms
memory: 73436kb

input:

199975 63264
143089 193533 14724 30117 151336 159132 86891 15693 118134 119687 76298 72176 191756 4650 81316 155772 185540 74162 9026 172656 132187 132731 190521 109252 109113 10042 52486 6362 108112 65030 60906 181748 69296 72559 184994 45045 120078 163180 29076 141690 131126 64895 192655 104908 65...

output:

238421486
4543725086
294450224
799139741
217393304
6225686
3169111
971476390
144829152
130406809
1934290334
18796349
370033458
1433054
1390040307
2201946721
41271000
206042135
393818776
2073333164
214242283
1660243288
54933143
2583686
4109569971
40036025
89174323
896103737
98547271
5400169418
214067...

result:

ok 999966 numbers

Test #10:

score: 23
Accepted
time: 662ms
memory: 72780kb

input:

199966 196893
7138 8317 161222 181002 51632 131690 182809 173475 151587 183293 13051 31375 173578 198970 178074 102195 11334 28300 40232 134863 61128 22622 129296 149038 25176 120305 159361 180345 82712 45590 158960 46691 31137 48725 69986 83526 171053 53007 185527 26613 69624 196727 79215 180473 18...

output:

607815290
81925820
952849427
1428298386
257801924
5174301682
115657992
18713510
1570166
193265018
2243638301
22279962
351257946
52532133
1960847529
4173491289
5701242306
4888260597
832791457
182446537
7166665903
936028434
4342746504
10994982535
917372005
3611924335
1764648091
285451
104790434
110586...

result:

ok 999963 numbers

Test #11:

score: 23
Accepted
time: 677ms
memory: 72328kb

input:

199979 22606
123819 59470 113269 67498 4614 169643 130514 89093 173400 118218 101346 123984 59297 112602 181199 38575 162116 8721 25765 148788 23136 48024 81940 188810 50147 5039 97853 129426 48219 38142 141537 2136 122759 4376 139377 107871 39709 60476 112887 2659 96590 50860 133038 61775 121610 25...

output:

39995834
455310497
1359955132
865407129
207698187
606535569
967004112
887528140
45855552
465721864
34372140
183041373
56317
542653266
1116829983
17046971
1523418769
579820593
111150735
272720834
51385971
250906881
64819158
118692985
71010904
105352546
963348713
135048042
217404777
44724041
7673224
1...

result:

ok 999950 numbers

Test #12:

score: 23
Accepted
time: 696ms
memory: 73216kb

input:

199952 147813
85537 104476 16022 159762 42603 66426 194440 38325 9214 96449 68685 172826 186487 132959 119609 180007 126334 166814 131088 93879 157935 7591 177342 44761 1380 167015 11055 49720 67180 179623 194975 104173 190838 31790 176935 194517 96413 197691 146113 175320 32104 122578 160231 54739 ...

output:

968001
4927512437
10580593454
149635669
92837096
87946
1086268674
7391722979
125446977
649305767
1548390500
6473158339
38054260
2829873482
1300589305
35755116
29447806
2585105290
190166857
111570467
1899106337
3993680898
8870883248
4457526094
3008019175
426595709
76737536
335754
616345455
124292915
...

result:

ok 999973 numbers

Test #13:

score: 23
Accepted
time: 646ms
memory: 73476kb

input:

199956 13475
33181 147686 191744 150551 189206 95988 110316 153862 117016 138687 127804 93876 147761 35457 27311 137 63072 24300 42034 151202 74116 112813 77474 76702 85133 16824 77128 43855 69894 178183 52125 116911 87065 155669 93821 54441 142939 101010 62346 108070 63878 31586 147732 139674 12335...

output:

216674
331681852
179861740
157163851
507003914
20275814
664860493
433067770
255450038
406503185
19153978
67749375
418984186
11410751
1257404
435810413
1005992674
767167006
220310332
76155953
110493891
206527870
18739489
13669132
47388842
544895661
94702622
228009316
622379737
79204478
127494246
6187...

result:

ok 999979 numbers

Test #14:

score: 23
Accepted
time: 705ms
memory: 71804kb

input:

199997 114680
88476 7803 15177 198962 142054 121049 171427 88937 56317 81465 93518 185463 132866 198459 100097 2421 36188 152011 31824 195707 769 135096 112075 92595 135292 84419 159233 166034 168055 158026 185647 156577 114242 70268 168348 165017 146861 10424 184715 66428 7847 2757 196205 106655 11...

output:

888984826
2703008811
2584377138
2426495410
604955
4984359267
115625138
4851361204
33259196
39075107
925125362
33692189
1842741021
5615998072
130037
1249198960
37581096
4432248219
115437509
1143600775
306037485
498088906
35553832
223310012
5243525077
2475235749
501012480
626922947
25395563
568128477
...

result:

ok 999979 numbers

Test #15:

score: 23
Accepted
time: 692ms
memory: 72936kb

input:

199951 95882
84130 44432 101994 74891 63233 78115 136239 80116 134168 46300 144313 106216 14430 168127 37654 95419 125572 85922 99006 40825 77070 28184 141557 153805 190659 179031 108593 185660 86075 3557 103762 179257 115085 14688 139474 119904 26513 131289 128916 141007 176501 154610 17996 8949 11...

output:

1040677074
327259805
656211401
488029436
3368817370
233553668
2656218705
6149882487
40545089
2379604320
17799399
452590306
653707512
83667415
5882193207
5125050585
2477944993
1208624245
155180760
1781036574
3124156297
930100372
3579593652
1091743160
803427624
2595713228
3714549629
6185376998
1055406...

result:

ok 999962 numbers

Test #16:

score: 23
Accepted
time: 679ms
memory: 73248kb

input:

199994 99108
17842 175056 15616 73231 11570 146296 7558 80875 103458 115623 196809 45406 30304 127466 80586 181308 196613 102236 169819 78094 102287 109727 63833 115448 85874 190464 15986 150315 74745 72281 187243 174476 136475 199486 63046 194555 186458 121569 133139 124791 149561 47559 2882 31527 ...

output:

1655954101
154989611
14350633
181642129
12217974
1319791169
963412300
9524953
916699504
2511375646
1233844884
1087293501
2005851254
2461479
4342740418
5405599
3793458090
218854244
5631521706
94327964
139869557
941833454
2070
964039590
4305919
23290243
1130510825
9402685
3864722467
227203224
59848513...

result:

ok 999957 numbers

Test #17:

score: 23
Accepted
time: 678ms
memory: 73488kb

input:

199961 73859
125326 15473 13036 185645 155532 3389 181491 116317 128605 87363 49236 103931 85789 73760 26333 46910 158737 196517 105401 100111 105268 16981 39418 63297 156285 111219 170284 146852 122743 21606 7513 3178 85295 110026 174026 48166 199362 189872 135179 193798 23829 44887 6254 19725 1265...

output:

1504498020
2190426468
401708053
111509336
351381100
1353735813
3881272014
9558
1752412167
223963400
3359843683
800036707
186059996
1135872048
1229551584
177372044
3424495
2787483090
197950787
221286954
3251784681
1035338366
15352660
2206331785
1070382197
2378192670
1372577016
1448445362
111103441
87...

result:

ok 999963 numbers

Test #18:

score: 23
Accepted
time: 717ms
memory: 73160kb

input:

199953 149307
193919 164596 36989 45408 154708 63352 52569 34586 64973 4482 34466 15931 48394 34826 45056 101865 143041 4761 121604 74878 122332 156252 116563 139742 59207 159281 21652 160744 106055 37686 87217 157794 15415 25138 8817 12399 170012 161480 181883 150933 162742 22588 102901 108858 7883...

output:

5154586614
724051412
4726527066
1362792286
5749609762
1665096563
4953362624
4165224012
1363948350
6580870722
3789977687
200460382
746360259
394775608
676253398
4336787067
47615461
518907865
365266237
2672845458
550929862
4949651
17911223
198428321
7250488562
435033197
1062581076
681184817
952303285
...

result:

ok 999977 numbers

Test #19:

score: 23
Accepted
time: 718ms
memory: 75128kb

input:

199967 164599
137204 20075 1396 13332 179417 85959 144867 97079 116886 50784 70888 55697 178654 135786 32087 110692 55319 188524 192663 52403 86270 113352 105871 79044 130573 65219 64065 166049 166249 141656 86650 30994 12202 18400 3366 74599 135234 52979 184773 119206 127135 68670 161254 50347 8298...

output:

2510623700
7390256
5369102605
44848508
2500697
679954603
4141647387
727832811
959563178
1327513241
178861488
753995214
5399410814
4950058178
1798
2440355856
6965549137
2223433654
1054103647
85077598
2966079
2123603410
1148138400
2959123364
8809523975
1164064205
6126288207
551639353
2871305838
113186...

result:

ok 999982 numbers

Test #20:

score: 23
Accepted
time: 665ms
memory: 72556kb

input:

199966 199082
166149 4457 161081 81141 158392 101572 93548 120377 75689 76519 146795 144414 156775 144348 57903 88114 16694 140267 43624 55623 35280 157456 119336 63440 162053 95470 159041 144103 69743 88536 63199 33259 135667 149083 76407 106969 29787 15173 22142 189876 57441 140375 194953 171253 8...

output:

84498040
49369895
3025556678
7137744
66705062
217596136
724358053
1426380906
4225238290
441255836
3641907159
1522493624
3555904
6916135460
867626761
5249226451
5114169127
18229310
4741161788
1758662035
74528016
5194515151
671381136
1043671001
1658585409
5357762643
655638622
4419197174
2056825935
464...

result:

ok 999974 numbers

Test #21:

score: 23
Accepted
time: 680ms
memory: 72312kb

input:

199983 165569
96304 169441 99989 178183 160714 24464 175331 55130 192577 154499 196783 94625 167371 78559 5436 197277 137250 172679 8025 99799 164998 143993 161079 23369 20392 199482 74859 197638 188853 189065 18282 76371 38488 123334 14711 58655 131232 89481 163654 145746 52313 157756 174316 69596 ...

output:

113609532
294625096
688628931
1773066359
3863536074
42233807
4325314946
3797599
9435488879
179792840
687819890
446583431
587154417
4623832446
2957991
4960050667
8486180614
368493
550692291
492487855
2825826300
470928644
16963375
3707963530
6251552918
1564732036
7233813546
43392651
193941990
40062499...

result:

ok 999966 numbers

Test #22:

score: 23
Accepted
time: 678ms
memory: 73128kb

input:

199991 134409
4362 122619 30089 98463 38863 139396 44738 11511 3470 71511 35519 139537 162095 144996 142324 165066 170621 17340 21083 193980 112159 33097 90789 27855 170259 182821 162771 187006 101310 113635 136605 63548 60282 74497 142540 12514 43888 100862 163287 182171 71588 199708 97814 170447 1...

output:

4885780
183704028
200290765
16876469
3047434902
102317911
70496031
71053941
772454423
4611989833
2796683317
17534065
2382894084
40824147
10660606
3333091559
1529002629
11458952
3576457
7070756335
5868570549
973944055
1183672700
264778388
513382443
187425118
31196519
12560597
2941956399
3792629627
68...

result:

ok 999960 numbers

Test #23:

score: 23
Accepted
time: 643ms
memory: 73068kb

input:

199990 45534
181543 65014 61395 2616 192767 75817 47884 190015 56428 35478 171055 68635 181413 83734 104529 41228 170060 93772 107137 193171 85784 22648 170127 165082 23662 5844 157840 171606 136837 168062 160205 118963 136764 85850 19725 157612 71695 64121 69298 71803 114909 165324 81531 179474 102...

output:

245681120
431660693
1930907070
97456438
104648694
1993018093
278994583
65723889
2448596429
502687983
2996784658
464811479
904874051
73582462
2504813048
735119199
2359309178
761293666
904575555
2047840054
641340170
1507689429
2887802326
438010601
646970491
1489158794
1058791437
510841921
884323696
10...

result:

ok 999985 numbers

Test #24:

score: 23
Accepted
time: 668ms
memory: 72924kb

input:

199983 82275
22775 19694 53085 22144 197524 75304 145272 107858 132147 135220 127260 88289 142624 55351 198276 63664 199020 62804 187303 102171 103882 18404 138398 125082 157237 88981 96137 182279 180633 176854 160079 130246 98040 45079 189248 108479 122120 47894 1834 1040 111854 60088 10085 127473 ...

output:

2908055123
12652796
1352806146
40333144
97956795
994356163
3741547901
639087319
367796559
105307865
538679547
139699470
3989112879
40264186
794309690
761733868
476565674
50603706
537942949
813398837
8677206
200382834
6428040936
3402645455
42703831
4030165990
372839073
980514405
4089057433
4251280678...

result:

ok 999996 numbers

Test #25:

score: 23
Accepted
time: 660ms
memory: 71336kb

input:

199982 41860
103649 160885 180244 42438 162557 179939 63504 35129 165463 97034 57770 181153 179741 25746 79023 28378 73384 11340 191988 32246 99280 12638 117923 129144 63384 51758 50856 165726 187772 127731 21663 186784 186244 54274 34735 179673 25107 87589 117528 25672 60085 125470 41952 24398 1749...

output:

267593900
3568079156
152838427
1005521314
23178034
931491094
513716
3169903458
10265411
330483848
149999524
848419785
407103889
1170190227
929363101
134357108
2492399571
1780342986
9996251
370102498
440867628
21435228
869865383
2544613131
561716871
2149394845
570590342
461628255
1250694616
662207252...

result:

ok 999986 numbers