QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#119712 | #138. Bali Sculptures | myee | 100 ✓ | 45ms | 1864kb | C++11 | 2.0kb | 2023-07-05 15:21:26 | 2023-07-05 15:21:28 |
Judging History
answer
#include <algorithm>
#include <bitset>
#include <stdio.h>
#include <vector>
typedef long long llt;
typedef unsigned uint;typedef unsigned long long ullt;
typedef bool bol;typedef char chr;typedef void voi;
typedef double dbl;
template<typename T>bol _max(T&a,T b){return(a<b)?a=b,true:false;}
template<typename T>bol _min(T&a,T b){return(b<a)?a=b,true:false;}
template<typename T>T lowbit(T n){return n&-n;}
template<typename T>T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T>T lcm(T a,T b){return(a!=0||b!=0)?a/gcd(a,b)*b:(T)0;}
template<typename T>T exgcd(T a,T b,T&x,T&y){if(b!=0){T ans=exgcd(b,a%b,y,x);y-=a/b*x;return ans;}else return y=0,x=1,a;}
template<typename T>T power(T base,T index,T mod)
{
T ans=1%mod;
while(index)
{
if(index&1)ans=ans*base%mod;
base=base*base%mod,index>>=1;
}
return ans;
}
typedef std::bitset<105>BIT;
const uint Lim=41;
BIT B[105],User;
ullt S[2005];
int main()
{
#ifdef MYEE
freopen("QAQ.in","r",stdin);
#endif
uint n,a,b;scanf("%u%u%u",&n,&a,&b);
for(uint i=1;i<=n;i++)scanf("%llu",S+i),S[i]+=S[i-1];
if(a>1){
ullt ans=0,w=0;
for(uint bit=Lim-1;~bit;bit--){
w|=1llu<<bit;
for(uint i=0;i<=b;i++)B[i]=BIT();
B[0][0]=1;
for(uint i=1;i<=n;i++){
for(uint j=0;j<i;j++)User[j]=!((S[i]-S[j])&w);
for(uint j=b;j;j--)B[j][i]=(User&B[j-1]).any();
}
bol ok=false;
for(uint i=a;i<=b;i++)ok|=B[i][n];
if(!ok)ans^=1llu<<bit,w^=1llu<<bit;
}
printf("%llu\n",ans);
}
else{
ullt ans=0,w=0;
for(uint bit=Lim-1;~bit;bit--){
w|=1llu<<bit;
static uint W[2005];
for(uint i=1;i<=n;i++){W[i]=1e9;for(uint j=0;j<i;j++)if(!((S[i]-S[j])&w))_min(W[i],W[j]+1);}
if(W[n]>b)ans^=1llu<<bit,w^=1llu<<bit;
}
printf("%llu\n",ans);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Accepted
Test #1:
score: 0
Accepted
time: 0ms
memory: 1548kb
input:
8 1 4 1 2 1 1 1 0 4 6
output:
6
result:
ok single line: '6'
Test #2:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
20 1 1 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
200
result:
ok single line: '200'
Test #3:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
20 1 3 8 1 1 1 8 2 2 4 2 8 8 1 4 1 1 4 2 4 2 8
output:
27
result:
ok single line: '27'
Test #4:
score: 0
Accepted
time: 0ms
memory: 1740kb
input:
20 1 17 4 2 4 1 8 8 4 1 4 2 2 1 1 2 1 8 1 8 1 2
output:
11
result:
ok single line: '11'
Test #5:
score: 0
Accepted
time: 0ms
memory: 1564kb
input:
1 1 1 0
output:
0
result:
ok single line: '0'
Test #6:
score: 0
Accepted
time: 0ms
memory: 1584kb
input:
5 1 3 3 4 8 8 6
output:
15
result:
ok single line: '15'
Test #7:
score: 0
Accepted
time: 0ms
memory: 1616kb
input:
10 1 1 9 7 3 3 7 9 0 9 1 4
output:
52
result:
ok single line: '52'
Test #8:
score: 0
Accepted
time: 0ms
memory: 1544kb
input:
15 1 15 0 7 4 1 3 1 0 5 4 3 9 1 3 1 3
output:
11
result:
ok single line: '11'
Test #9:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
17 1 3 10 5 7 3 5 9 0 10 10 7 6 3 3 0 6 8 8
output:
47
result:
ok single line: '47'
Test #10:
score: 0
Accepted
time: 0ms
memory: 1688kb
input:
20 1 3 3 0 9 7 1 2 6 0 0 2 1 8 5 5 3 2 9 8 7 9
output:
43
result:
ok single line: '43'
Test #11:
score: 0
Accepted
time: 0ms
memory: 1552kb
input:
20 1 3 9 9 8 8 10 8 8 8 8 9 9 8 8 8 9 8 10 8 9 8
output:
62
result:
ok single line: '62'
Test #12:
score: 0
Accepted
time: 0ms
memory: 1532kb
input:
20 1 3 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
94
result:
ok single line: '94'
Subtask #2:
score: 0
Accepted
Test #13:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
6 2 3 1 1 1 1 1 1
output:
2
result:
ok single line: '2'
Test #14:
score: 0
Accepted
time: 0ms
memory: 1808kb
input:
20 4 7 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
30
result:
ok single line: '30'
Test #15:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
20 2 2 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
100
result:
ok single line: '100'
Test #16:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
20 2 7 1 4 8 1 4 4 1 1 2 8 2 2 4 1 1 1 8 2 2 4
output:
13
result:
ok single line: '13'
Test #17:
score: 0
Accepted
time: 0ms
memory: 1692kb
input:
20 5 13 1 4 8 1 2 8 1 1 8 8 8 4 4 2 2 1 2 4 8 1
output:
15
result:
ok single line: '15'
Test #18:
score: 0
Accepted
time: 0ms
memory: 1592kb
input:
6 6 6 0 0 0 1 1 2
output:
3
result:
ok single line: '3'
Test #19:
score: 0
Accepted
time: 0ms
memory: 1856kb
input:
6 3 6 6 5 0 0 0 1
output:
7
result:
ok single line: '7'
Test #20:
score: 0
Accepted
time: 0ms
memory: 1736kb
input:
5 2 3 7 5 6 9 8
output:
15
result:
ok single line: '15'
Test #21:
score: 0
Accepted
time: 0ms
memory: 1544kb
input:
10 2 4 9 6 6 9 6 1 3 2 5 2
output:
15
result:
ok single line: '15'
Test #22:
score: 0
Accepted
time: 0ms
memory: 1592kb
input:
15 15 15 4 9 8 4 5 7 1 5 3 7 10 5 4 2 4
output:
15
result:
ok single line: '15'
Test #23:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
17 3 3 3 6 7 9 9 5 7 5 6 2 6 2 10 8 7 9 7
output:
43
result:
ok single line: '43'
Test #24:
score: 0
Accepted
time: 0ms
memory: 1612kb
input:
20 4 7 9 8 7 2 10 1 3 2 5 0 10 3 6 5 2 3 10 1 3 5
output:
19
result:
ok single line: '19'
Test #25:
score: 0
Accepted
time: 0ms
memory: 1584kb
input:
20 4 7 10 10 8 10 9 10 10 8 10 9 9 8 10 8 8 10 10 9 8 9
output:
31
result:
ok single line: '31'
Subtask #3:
score: 0
Accepted
Test #26:
score: 0
Accepted
time: 0ms
memory: 1568kb
input:
5 1 3 451631570 250518388 397580948 477427142 699144811
output:
1040187263
result:
ok single line: '1040187263'
Test #27:
score: 0
Accepted
time: 0ms
memory: 1692kb
input:
20 1 20 262144 512 33554432 256 16384 32 8388608 2097152 536870912 524288 64 1024 32768 134217728 67108864 2048 4096 128 268435456 1048576
output:
1052565472
result:
ok single line: '1052565472'
Test #28:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
10 1 4 585497577 747583750 169121856 897466290 878323190 352710279 143784633 220521827 564660939 846262488
output:
1877999615
result:
ok single line: '1877999615'
Test #29:
score: 0
Accepted
time: 0ms
memory: 1588kb
input:
13 1 13 367240258 398331246 114577190 805340028 665732200 504546242 482288665 570430757 818499982 730773252 786783376 500542223 778268439
output:
1073741823
result:
ok single line: '1073741823'
Test #30:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
19 1 3 940393783 972698245 425028628 391884379 863783831 41452681 868278979 777610289 402380933 595956585 956811665 979360137 430377354 468928181 931413765 812044607 856244061 741313322 360289985
output:
5886697470
result:
ok single line: '5886697470'
Test #31:
score: 0
Accepted
time: 0ms
memory: 1520kb
input:
20 1 7 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
output:
4000000000
result:
ok single line: '4000000000'
Test #32:
score: 0
Accepted
time: 0ms
memory: 1748kb
input:
20 1 1 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
output:
20000000000
result:
ok single line: '20000000000'
Test #33:
score: 0
Accepted
time: 0ms
memory: 1860kb
input:
20 1 13 1024 512 64 1024 8388608 33554432 64 65536 4194304 4194304 16384 131072 128 65536 524288 4096 16777216 4194304 268435456 512
output:
323704448
result:
ok single line: '323704448'
Test #34:
score: 0
Accepted
time: 0ms
memory: 1740kb
input:
20 1 20 2097152 1024 524288 1024 65536 64 4194304 268435456 262144 2097152 1024 536870912 2097152 131072 268435456 512 67108864 64 2097152 536870912
output:
879691328
result:
ok single line: '879691328'
Test #35:
score: 0
Accepted
time: 0ms
memory: 1752kb
input:
20 1 3 8388608 33554432 262144 256 16777216 2048 32768 4096 2097152 134217728 67108864 4194304 512 64 268435456 131072 16384 65536 32 524288
output:
535812960
result:
ok single line: '535812960'
Subtask #4:
score: 0
Accepted
Test #36:
score: 0
Accepted
time: 0ms
memory: 1552kb
input:
21 1 20 7 2 8 9 5 5 2 8 3 0 5 0 5 9 3 4 1 4 7 7 10
output:
15
result:
ok single line: '15'
Test #37:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
50 1 10 8 8 6 4 10 8 2 2 5 4 6 3 3 7 2 4 8 1 3 9 9 6 4 4 10 8 1 5 4 10 7 1 6 5 7 5 3 5 9 1 8 4 10 2 10 2 3 1 4 4
output:
31
result:
ok single line: '31'
Test #38:
score: 0
Accepted
time: 0ms
memory: 1748kb
input:
25 1 10 4 0 8 2 7 2 6 9 10 3 4 1 4 8 4 4 7 7 10 9 5 0 8 3 10
output:
23
result:
ok single line: '23'
Test #39:
score: 0
Accepted
time: 0ms
memory: 1484kb
input:
38 1 5 4 8 8 4 5 5 3 7 10 6 1 3 10 3 2 9 7 4 7 3 5 5 10 5 0 3 9 7 9 4 7 7 4 10 7 9 5 6
output:
47
result:
ok single line: '47'
Test #40:
score: 0
Accepted
time: 0ms
memory: 1496kb
input:
42 1 18 1 4 4 7 2 9 5 6 0 1 9 5 3 2 8 0 7 9 8 2 5 6 10 0 10 4 0 5 4 2 3 1 0 1 0 4 4 1 7 4 10 7
output:
15
result:
ok single line: '15'
Test #41:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
50 1 20 9 8 8 9 10 10 8 9 8 8 9 10 9 8 10 9 9 10 8 10 8 8 10 9 10 10 9 9 9 10 8 8 9 9 10 9 10 8 9 9 8 9 8 9 10 10 9 9 9 9
output:
27
result:
ok single line: '27'
Test #42:
score: 0
Accepted
time: 0ms
memory: 1532kb
input:
50 1 20 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
30
result:
ok single line: '30'
Test #43:
score: 0
Accepted
time: 0ms
memory: 1492kb
input:
50 1 1 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
output:
500
result:
ok single line: '500'
Test #44:
score: 0
Accepted
time: 0ms
memory: 1744kb
input:
50 1 20 2 2 6 1 8 4 10 1 2 4 1 3 4 5 5 4 2 5 1 4 8 3 9 8 4 6 5 10 6 6 6 2 4 5 8 3 8 1 1 4 4 10 4 4 6 3 7 3 6 8
output:
15
result:
ok single line: '15'
Test #45:
score: 0
Accepted
time: 0ms
memory: 1592kb
input:
50 1 17 4 10 3 4 2 8 6 6 4 2 8 8 5 4 9 4 10 1 4 6 3 8 3 3 8 3 8 9 8 5 5 2 8 3 8 1 9 9 6 1 10 10 8 7 1 9 8 2 5 9
output:
23
result:
ok single line: '23'
Subtask #5:
score: 0
Accepted
Test #46:
score: 0
Accepted
time: 0ms
memory: 1616kb
input:
51 1 20 6 10 12 9 0 3 14 3 0 1 18 20 4 9 7 16 11 15 17 16 10 15 11 1 6 16 19 15 12 17 10 3 6 5 14 6 11 0 18 6 0 2 4 7 7 16 7 9 10 13 0
output:
31
result:
ok single line: '31'
Test #47:
score: 0
Accepted
time: 0ms
memory: 1860kb
input:
65 1 10 4 4 16 20 4 4 1 16 19 7 7 6 7 13 3 17 6 1 18 4 18 11 10 5 6 16 19 12 15 11 1 2 11 9 17 2 3 18 18 4 14 19 6 8 0 16 7 5 17 10 1 12 2 7 17 15 12 13 18 2 12 7 12 8 14
output:
79
result:
ok single line: '79'
Test #48:
score: 0
Accepted
time: 0ms
memory: 1732kb
input:
78 1 23 1 7 6 6 16 19 4 1 3 19 4 11 14 5 11 6 18 15 3 19 1 16 3 11 9 18 4 3 16 5 15 20 19 16 20 15 7 11 4 13 8 5 11 16 5 19 10 0 11 13 16 3 9 13 13 4 9 4 8 18 4 15 15 1 1 2 15 19 9 9 12 14 1 12 10 16 9 1
output:
47
result:
ok single line: '47'
Test #49:
score: 0
Accepted
time: 0ms
memory: 1584kb
input:
91 1 55 17 10 12 19 18 1 10 7 15 15 10 8 1 4 20 1 6 4 11 11 2 3 17 5 20 4 11 6 6 20 1 0 2 5 19 15 9 20 18 1 2 17 14 5 11 14 13 12 11 13 4 16 20 8 13 6 0 7 15 10 15 2 19 17 0 16 17 16 18 2 3 13 12 7 20 6 1 17 6 4 5 19 11 18 5 19 12 17 15 8 11
output:
31
result:
ok single line: '31'
Test #50:
score: 0
Accepted
time: 0ms
memory: 1748kb
input:
100 1 100 14 12 3 1 15 7 6 13 16 16 0 2 12 5 13 6 18 18 3 5 13 14 5 19 12 20 2 1 2 4 13 14 4 13 9 12 4 20 1 10 10 19 10 5 1 7 3 15 9 4 2 9 10 20 15 10 11 13 5 12 2 15 8 1 18 5 7 15 4 11 9 18 20 14 10 8 9 10 18 10 11 0 7 12 6 15 19 0 9 0 15 19 0 2 20 0 9 1 20 17
output:
31
result:
ok single line: '31'
Test #51:
score: 0
Accepted
time: 0ms
memory: 1576kb
input:
100 1 100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20...
output:
20
result:
ok single line: '20'
Test #52:
score: 0
Accepted
time: 0ms
memory: 1748kb
input:
100 1 1 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2...
output:
2000
result:
ok single line: '2000'
Test #53:
score: 0
Accepted
time: 0ms
memory: 1540kb
input:
100 1 47 18 1 15 15 2 14 19 16 8 19 1 7 12 5 16 1 5 15 13 15 16 20 8 20 9 13 7 19 8 2 4 4 4 17 5 19 19 16 2 5 13 19 9 19 5 14 17 7 12 13 16 8 7 20 10 20 7 14 19 2 9 8 11 18 19 12 9 13 20 16 10 15 9 16 17 6 20 2 19 20 15 20 8 11 12 4 20 18 1 13 8 1 9 16 12 18 17 1 3 19
output:
47
result:
ok single line: '47'
Test #54:
score: 0
Accepted
time: 0ms
memory: 1580kb
input:
100 1 74 18 7 6 16 5 12 15 13 20 18 20 7 14 19 7 19 19 15 11 16 12 16 1 20 20 12 11 18 17 14 2 9 13 6 2 8 14 11 2 7 14 19 11 20 20 13 18 16 4 10 15 9 17 20 13 15 15 7 7 8 12 20 10 15 15 11 14 19 4 16 1 19 5 17 2 4 7 20 11 1 9 7 4 10 20 19 20 11 20 16 16 11 9 17 3 17 14 12 19 18
output:
31
result:
ok single line: '31'
Subtask #6:
score: 0
Accepted
Test #55:
score: 0
Accepted
time: 0ms
memory: 1692kb
input:
51 1 20 112872931 738945953 683278169 770763749 516510818 790818428 875172481 703986370 60868760 918060338 785761560 775662511 633498896 598270657 590667589 115223551 657182582 662359373 423527461 442741161 404625684 341975402 396747626 126186088 753822361 159840892 743886212 135361223 217348329 815...
output:
1879048191
result:
ok single line: '1879048191'
Test #56:
score: 0
Accepted
time: 0ms
memory: 1860kb
input:
78 1 23 923836836 523842025 628289587 924227079 511267571 346625165 475175021 523287606 3271072 999700331 430350383 323930009 277651833 815950669 597401459 131691797 817247070 850190120 147094539 635552447 96152698 394931183 18786201 365063794 224640001 634087931 406098387 613191072 187802232 111285...
output:
2147352575
result:
ok single line: '2147352575'
Test #57:
score: 0
Accepted
time: 0ms
memory: 1740kb
input:
91 1 55 191959221 117819710 21264154 656591012 279993862 188274213 569336572 16754469 254308293 828635036 133436262 582998229 24339854 543319667 239350173 233498655 970615437 803033323 643769343 574033553 433337176 821491460 181307754 588563382 773726647 999120732 855920243 795015906 870316112 36016...
output:
1073741823
result:
ok single line: '1073741823'
Test #58:
score: 0
Accepted
time: 0ms
memory: 1860kb
input:
100 1 100 897262517 59435838 206381882 362222066 578479976 350662687 580375972 513311419 914695972 558448041 714198210 35193263 88788756 392388113 661818429 619520494 671073907 598522001 349238691 22508880 972902100 818892889 461953972 59786923 741831386 325254397 577331165 510157907 444761786 90036...
output:
1073741823
result:
ok single line: '1073741823'
Test #59:
score: 0
Accepted
time: 0ms
memory: 1732kb
input:
100 1 100 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000...
output:
1000000000
result:
ok single line: '1000000000'
Test #60:
score: 0
Accepted
time: 0ms
memory: 1484kb
input:
100 1 1 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000...
output:
100000000000
result:
ok single line: '100000000000'
Test #61:
score: 0
Accepted
time: 0ms
memory: 1580kb
input:
100 1 100 4719616 16400 9744 524296 4204580 34304 2195712 637534212 16385 318767744 41943104 268566784 2107408 65536 33620224 32896 34078724 8388736 132616 17 268566944 268435777 822088256 612368384 403702272 679510528 16777216 2097477 147712 1050624 37765144 5 5898272 16453 806618112 201335296 2684...
output:
1040187359
result:
ok single line: '1040187359'
Test #62:
score: 0
Accepted
time: 0ms
memory: 1720kb
input:
100 1 100 524800 268435472 3153920 528960 128 277872656 262144 269484036 16416 33620496 344195072 4194304 8358 1024 273416212 5242907 1024 4096 262656 69208449 1098756 86016008 285343744 16777216 133120 65540 16843264 33816600 310380048 71434312 138739716 4194313 268575044 33693832 4194304 16777728 ...
output:
1006630911
result:
ok single line: '1006630911'
Subtask #7:
score: 0
Accepted
Test #63:
score: 0
Accepted
time: 1ms
memory: 1532kb
input:
90 45 90 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2 0 0 0 1 1 2
output:
2
result:
ok single line: '2'
Test #64:
score: 0
Accepted
time: 1ms
memory: 1584kb
input:
100 47 74 268439560 67108864 135266304 42074240 8192 654311440 3146005 151136512 25346080 32996 539000832 814809088 589824 9048320 67240448 134218368 331844 2113577 524288 545260544 78208 256 50335808 16793604 536875016 50331688 285212684 274860032 1048576 8192 671105024 262144 41364 805339152 2048 ...
output:
1073676287
result:
ok single line: '1073676287'
Test #65:
score: 0
Accepted
time: 0ms
memory: 1688kb
input:
100 33 66 42500608 541065216 33284 16436 8388616 5376002 268436482 69185 8192 1024 34078720 16777216 264448 269131776 131908 75393 268437512 285278401 8208 33554689 557060 2097184 12591106 134217728 536903698 534784 16777220 256 16777232 423624712 21233664 293634050 136 35651587 663552 134234113 671...
output:
1065352959
result:
ok single line: '1065352959'
Test #66:
score: 0
Accepted
time: 0ms
memory: 1496kb
input:
51 11 20 140150592 3734210 15789782 587667925 232084407 771056473 802447725 807351149 325461838 227735654 492223279 354958716 373810782 666553782 514404606 711298506 863206542 686610915 442109880 823668609 358013640 920121296 306118243 610522093 931738265 472669282 324095528 121814877 760604986 7006...
output:
2080374783
result:
ok single line: '2080374783'
Test #67:
score: 0
Accepted
time: 1ms
memory: 1744kb
input:
65 2 10 396169868 359949875 502267077 450740086 507121397 570144940 23894085 71143618 62920474 102895297 269825202 227951844 706777068 130693744 354410473 880548203 59480734 236985238 293898169 8305051 909907329 558305057 671268876 68669724 976783949 147069678 881735781 940128032 259987387 767336296...
output:
3187671039
result:
ok single line: '3187671039'
Test #68:
score: 0
Accepted
time: 1ms
memory: 1600kb
input:
78 2 23 249890663 783223191 80338675 989476041 452741517 119332314 815744289 832096085 807056767 447208859 943873124 166653816 711179298 899068905 723907090 616980020 574611274 841834853 222559367 672421207 822239943 466913882 990180497 2542747 910439935 238984082 430538469 911475582 354354169 51971...
output:
3187671039
result:
ok single line: '3187671039'
Test #69:
score: 0
Accepted
time: 1ms
memory: 1688kb
input:
91 19 55 199776664 784097501 551979695 849215761 888617731 297981863 230030135 382048933 92483014 111260499 719179517 575225173 963577465 368761993 49577610 731641140 442506781 872881983 679540886 42778343 577941084 784112324 190303846 704666976 803326689 629828194 367910926 376969061 604894999 2556...
output:
2080374783
result:
ok single line: '2080374783'
Test #70:
score: 0
Accepted
time: 1ms
memory: 1580kb
input:
100 57 100 334307059 743986690 394947001 774420772 414996669 819048591 476647461 269780869 374745898 133397578 517410677 385491967 667457113 998436194 972773244 495932276 404452026 975078683 630798486 828348071 21785563 662538552 297332556 424596861 285813802 760543927 983316876 611288856 963039237 ...
output:
1073741823
result:
ok single line: '1073741823'
Test #71:
score: 0
Accepted
time: 1ms
memory: 1628kb
input:
100 57 100 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100...
output:
1000000000
result:
ok single line: '1000000000'
Test #72:
score: 0
Accepted
time: 0ms
memory: 1748kb
input:
100 2 2 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 100000...
output:
50000000000
result:
ok single line: '50000000000'
Test #73:
score: 0
Accepted
time: 1ms
memory: 1568kb
input:
100 2 100 539042816 312475648 51904512 8200 32768 67109376 655361 8192 810027008 270799872 268570628 64 574620802 289406976 16978240 4 268440584 1 278528 310394880 268442248 271584256 2113684 268506240 80 136381064 17039888 1152 1 18874372 50 768 8224 536877064 268469633 4608 4672 16777220 4390976 6...
output:
1006632959
result:
ok single line: '1006632959'
Subtask #8:
score: 0
Accepted
Test #74:
score: 0
Accepted
time: 1ms
memory: 1580kb
input:
101 1 20 109288331 167187936 289459547 455669706 656308194 233503022 562258473 2210429 243994669 58628149 750503963 610269250 29072940 251143410 458350486 696874700 870849343 646709707 646709077 746808795 87439926 187779526 762073671 569489420 380238922 982163795 784978520 933220915 264403502 755738...
output:
3221159935
result:
ok single line: '3221159935'
Test #75:
score: 0
Accepted
time: 43ms
memory: 1748kb
input:
2000 1 1 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...
output:
2000000000000
result:
ok single line: '2000000000000'
Test #76:
score: 0
Accepted
time: 1ms
memory: 1860kb
input:
101 1 20 3178496 147472 65536 4097 536871280 269484544 131073 545529856 9437185 1050625 524288 17039872 536871168 335544320 142876672 540672 293605380 33837060 69206026 147470 536870912 138412416 53312 16859408 512 688914464 268502097 4194304 138420224 67375104 268437505 4 153094656 72884225 131204 ...
output:
939524093
result:
ok single line: '939524093'
Test #77:
score: 0
Accepted
time: 6ms
memory: 1744kb
input:
747 1 747 872677712 534769599 469586233 803192414 970766636 402041633 924777851 479395567 796851179 889150331 33816576 1376305 67338776 885784651 172828579 796916183 828127160 666826749 570426386 142873152 4195392 8392704 202125827 159981831 384094985 3429637 871890427 553790464 482080341 640 676455...
output:
1073741823
result:
ok single line: '1073741823'
Test #78:
score: 0
Accepted
time: 13ms
memory: 1748kb
input:
999 1 20 501592047 729808856 984467038 10659840 838860759 465498062 966091518 324395006 653770747 937163246 725548604 998244342 971988987 427818750 16777216 937145651 988659709 1639456 771743485 862328498 21416961 911410407 939489247 520058487 268431293 73225958 858842517 929038334 532279641 1657777...
output:
29527900159
result:
ok single line: '29527900159'
Test #79:
score: 0
Accepted
time: 11ms
memory: 1744kb
input:
1000 1 1000 867893110 737407993 964657119 839401474 335278074 533064702 532670463 872413119 247050698 828399482 383770399 140808327 620493044 545061477 805298047 969932791 701351839 794720607 207565799 787726189 1055366 475841263 527826847 501443216 363158270 679707328 871497675 33554496 673197251 9...
output:
1073741823
result:
ok single line: '1073741823'
Test #80:
score: 0
Accepted
time: 21ms
memory: 1552kb
input:
1404 1 400 996016127 753881079 939524091 973074303 460691488 651778380 518455258 6816306 966784941 536868335 377420274 872415231 989855743 805305719 931119087 897495786 991531403 903096558 135534660 939514879 805306367 889188223 805240831 786321271 998456433 67176507 511688190 845414268 921698239 96...
output:
3221225471
result:
ok single line: '3221225471'
Test #81:
score: 0
Accepted
time: 31ms
memory: 1548kb
input:
1747 1 1747 419168221 536866815 519962622 802944767 766055134 737669055 517992447 788529151 997195775 801112055 771749627 998244351 264109051 805306367 973073914 973078523 373283945 4227338 805306367 528482303 536608639 972795839 920190773 938982251 536346623 937426943 805273279 536852479 753307708 ...
output:
1073741823
result:
ok single line: '1073741823'
Test #82:
score: 0
Accepted
time: 41ms
memory: 1568kb
input:
2000 1 1 997585431 409966543 805306319 932180863 998244335 770631862 939522047 989855743 973076415 939515895 989851647 938475519 805304287 193122769 998244351 935287290 268505088 800505309 989855743 997191679 528478063 935853053 922680470 805304059 998244343 805306367 805230555 532676605 804257663 9...
output:
1377133371455
result:
ok single line: '1377133371455'
Test #83:
score: 0
Accepted
time: 45ms
memory: 1600kb
input:
2000 1 55 804782079 997711727 939524079 935329759 938475455 939491327 536870910 875653390 768587671 805302271 520044535 667952897 613900261 81880824 532676535 989855743 160 753908790 536870879 939507711 536870655 939458287 536870911 640 816910493 939524095 804731167 503316223 872005443 805306363 536...
output:
25769803775
result:
ok single line: '25769803775'
Test #84:
score: 0
Accepted
time: 41ms
memory: 1584kb
input:
2000 1 2000 536866815 805306367 939524087 536875520 532676607 939524095 413479424 803209215 804780031 733074303 536862703 536870911 939524095 536870911 796393215 805044223 536870815 937426941 284848635 534773759 999980031 469237759 536870143 805306367 952081405 989331455 536944640 141992373 97307852...
output:
1073741823
result:
ok single line: '1073741823'
Test #85:
score: 0
Accepted
time: 2ms
memory: 1744kb
input:
575 1 99 671818063 209790154 33859933 477856285 57026585 72014110 690300938 369069913 507130793 2421736 453376603 598817195 993803344 403318621 948052360 130185809 544082512 384526278 26902059 445144575 117024146 369208194 99994944 909661273 817736161 722089202 81195175 297802564 270856394 277487160...
output:
3221225471
result:
ok single line: '3221225471'
Test #86:
score: 0
Accepted
time: 6ms
memory: 1864kb
input:
747 1 747 567068093 996151088 601220931 600314942 328186958 422862730 705432599 920649855 134591108 641235186 784647994 476211603 476769687 279423355 557229060 249213963 908509087 393261995 96221111 334823226 66800058 819779564 846437907 951627848 132809919 374002505 481710027 606800851 255660163 56...
output:
1073741823
result:
ok single line: '1073741823'
Test #87:
score: 0
Accepted
time: 13ms
memory: 1552kb
input:
999 1 20 542463232 396016 216079710 374235392 71969230 447711939 231071756 568215997 776535815 580902919 224213418 729619005 773745461 711752120 926979909 335037191 928033481 580185855 750092238 884353818 684117020 893508600 735788412 397874798 710170106 436907062 528670197 584550235 905484357 41378...
output:
25702694911
result:
ok single line: '25702694911'
Test #88:
score: 0
Accepted
time: 11ms
memory: 1576kb
input:
1000 1 55 334822803 795120696 425907731 669595627 573260950 377454873 83285100 71448275 727123368 18880313 362340625 890699220 874768695 922576328 709528940 933587306 694233996 31976649 23826865 780684719 544656651 671935237 990649697 716305390 260586928 811661531 857200123 660467953 718829793 81338...
output:
9663676415
result:
ok single line: '9663676415'
Test #89:
score: 0
Accepted
time: 41ms
memory: 1556kb
input:
2000 1 1000 308973563 285218009 898860488 326136111 298842651 531007164 427501028 589991719 636680077 264340825 491708053 41473921 188912957 255634170 237630501 833222078 931006391 938002553 955701502 724036225 106046281 289773809 856882750 690629452 688270571 213832046 321195479 206443566 31288874 ...
output:
2147483647
result:
ok single line: '2147483647'
Test #90:
score: 0
Accepted
time: 37ms
memory: 1748kb
input:
2000 1 2000 754373971 534920425 565664451 751250180 684018027 850242294 502712230 693903460 608123242 390646088 967338056 856570366 337623704 510643925 621810282 209681472 81126367 470854072 679511602 312761719 636225777 841124044 15034402 679709829 932459558 749985774 249422304 364729819 257332281 ...
output:
1073741823
result:
ok single line: '1073741823'
Test #91:
score: 0
Accepted
time: 37ms
memory: 1736kb
input:
2000 1 2000 999999604 999999209 999999131 999999075 999999433 999999077 999999266 999999332 999999323 999999057 999999036 999999140 999999029 999999586 999999342 999999283 999999544 999999564 999999572 999999407 999999154 999999068 999999226 999999837 999999513 999999613 999999496 999999047 99999999...
output:
1000001535
result:
ok single line: '1000001535'
Test #92:
score: 0
Accepted
time: 37ms
memory: 1612kb
input:
2000 1 2000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10...
output:
1000000000
result:
ok single line: '1000000000'
Subtask #9:
score: 9
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Subtask #10:
score: 16
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #4:
100%
Accepted
Subtask #11:
score: 21
Accepted
Dependency #1:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Subtask #12:
score: 25
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #7:
100%
Accepted
Subtask #13:
score: 29
Accepted
Dependency #1:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Dependency #8:
100%
Accepted
Extra Test:
score: 0
Extra Test Passed