QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#75596 | #4917. 中奖率 | 4182_543_731 | 41 | 933ms | 3668kb | C++20 | 3.5kb | 2023-02-05 21:23:58 | 2023-02-05 21:24:00 |
Judging History
answer
#pragma GCC optimize(3)
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
//simple integer
#define ll long long
ll bs=1e18;
struct integer{
vector<ll> v;
explicit operator bool()const{return !v.empty();}
void add(ll a)
{
ll rs=a;
for(int i=0;rs;i++)
{
if(i>=v.size())v.push_back(0);
rs+=v[i];
v[i]=rs%bs;
rs/=bs;
}
}
void mul(ll a)
{
__int128 rs=0;
for(int i=0;i<v.size()||rs;i++)
{
if(i>=v.size())v.push_back(0);
rs+=(__int128)a*v[i];
v[i]=rs%bs;
rs/=bs;
}
}
void div(ll a)
{
int sz=v.size();
ll rs=0;
for(int i=sz-1;i>=0;i--)
{
__int128 ri=(__int128)bs*rs+v[i];
v[i]=ri/a;rs=ri%a;
}
while(v.size()&&v.back()==0)v.pop_back();
}
ll mod(ll a)
{
int sz=v.size();
ll rs=0;
for(int i=sz-1;i>=0;i--)
{
__int128 ri=(__int128)bs*rs+v[i];
rs=ri%a;
}
return rs;
}
};
#define N 105000
char s[N];
integer input()
{
integer si;
scanf("%s",s+1);
ll s1=1,s2=0;
int le=1;
while(s[le+1])le++;
while(le)
{
s2+=s1*(s[le]-'0');s1*=10;
if(s1==bs)si.v.push_back(s2),s1=1,s2=0;
le--;
}
if(s2)si.v.push_back(s2);
return si;
}
void output(integer s)
{
if(!s){printf("0\n");return;}
printf("%lld",s.v.back());
for(int i=(int)s.v.size()-2;i>=0;i--)printf("%018lld",s.v[i]);
printf("\n");
}
int n,q,a,su[N],fg;
ll calc(ll a,ll b)
{
ll si=0;
//sum la*s/lx/n-i/n
for(int i=1;i<=n;i++)if(1ll*su[i]*n>1ll*su[n]*i)
{
ll la=1ll*su[i]*n-1ll*su[n]*i;
ll ri=(ll)(1.0*la/b*a+1e-8)+n-i;
si+=ri/n;
}
return si;
}
void query1(integer s)
{
if(!fg)
{
int ci=0;
for(int i=1;i<=n;i++)if(1ll*su[i]*n==1ll*su[n]*i)ci++;
int ri=s.mod(ci);
s.div(ci);s.mul(n);
for(int i=1;i<=n;i++)if(1ll*su[i]*n==1ll*su[n]*i)
{
ri--;
if(!ri)s.add(i);
}
output(s);
return;
}
ll s1=0;
for(int i=1;i<=n;i++)if(1ll*su[i]*n>1ll*su[n]*i)s1+=1ll*su[i]*n-1ll*su[n]*i;
ll re=s.mod(s1);s.div(s1);
if(s)s.add(-1),re+=s1;
ll lb=0,rb=2ll*n*n*n,fr=1ll*n*n,as=0;
while(lb<=rb)
{
ll mid=(lb+rb)>>1;
if(calc(mid,fr)<re)as=mid,lb=mid+1;
else rb=mid-1;
}
re-=calc(as,fr);
vector<pair<ll,int> > tp;
for(int i=1;i<=n;i++)if(1ll*su[i]*n>1ll*su[n]*i)
{
ll la=1ll*su[i]*n-1ll*su[n]*i;
__int128 ri=(__int128)la*as+fr*n-i*fr;
if(ri/n/fr!=(ri+la)/n/fr)tp.push_back(make_pair(la,i));
}
sort(tp.begin(),tp.end());
int sx=tp[re-1].second;
ll ry=(__int128)(as+1)*(1ll*su[sx]*n-1ll*su[n]*sx)/fr;
s.mul(1ll*su[sx]*n-1ll*su[n]*sx);s.mul(n);s.add(ry);
output(s);
}
void query2(integer s)
{
int id=s.mod(n);
if(!id)id=n;
if(1ll*su[id]*n<1ll*su[n]*id||(1ll*su[id]*n==1ll*su[n]*id&&fg)){printf("inf\n");return;}
if(1ll*su[id]*n==1ll*su[n]*id)
{
s.div(n);
int ci=0,c2=0;
for(int i=1;i<=n;i++)if(1ll*su[i]*n==1ll*su[n]*i)ci++,c2+=id<n&&i<=id;
s.mul(ci);s.add(c2);
output(s);
return;
}
ll lx=1ll*su[id]*n-1ll*su[n]*id,rs=lx*n,ri=s.mod(rs);
s.div(rs);
if(s)s.add(-1),ri+=rs;
ll s1=0;
for(int i=1;i<=n;i++)if(1ll*su[i]*n>1ll*su[n]*i)s1+=1ll*su[i]*n-1ll*su[n]*i;
s.mul(s1);
//sum la*s/lx/n-i/n
for(int i=1;i<=n;i++)if(1ll*su[i]*n>1ll*su[n]*i)
{
ll la=1ll*su[i]*n-1ll*su[n]*i;
__int128 r1=(__int128)la*ri-i*lx-(la>lx)+n*lx;
s.add(r1/n/lx);
}
output(s);
}
int main()
{
scanf("%d%d%s",&n,&q,s+1);
for(int i=1;i<=n;i++)su[i]=su[i-1]+s[i]-'0';
for(int i=1;i<n;i++)if(1ll*su[i]*n>1ll*su[n]*i)fg=1;
while(q--)
{
scanf("%d",&a);integer b=input();
if(a==1)query1(b);else query2(b);
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 1
Accepted
Test #1:
score: 1
Accepted
time: 6ms
memory: 3548kb
input:
93594 19 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
803592238894397000180010742478410576139869323112765266001511168406933953751236048305575854734087992434865734898666775073462056595681265138821122297618629090129568166018988058397842512784043408247048475083486672197520209680936205310495190027161434933868319162317581353076485586012510746832534790123318...
result:
ok 19 tokens
Test #2:
score: 0
Accepted
time: 0ms
memory: 3664kb
input:
91106 19 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
inf inf inf inf 13250042107896464722639737551541466942179901318817839832766590049487752727865912250795382770204236165270082111796839055561744227636073331650212700910581348097835459150251688363718468552900251250148301582337176568548165076825749090832639499887382431511630515262690992013373658775659429...
result:
ok 19 tokens
Test #3:
score: 0
Accepted
time: 3ms
memory: 3536kb
input:
91004 19 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
615583033926412665379213953324038024217834471026294801388188380855415202841104551684169952830165295737948000277599376689161324741020690179665753283567317214074727589342722310194779455556310818004374376474764064937590258429980614187691752943635481928305924995147441001944209678975366299644962193997878...
result:
ok 19 tokens
Test #4:
score: 0
Accepted
time: 1ms
memory: 3520kb
input:
90255 20 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
499599650596627581409270516073361171534798169651401128905539595097904284149229507117902151246635636602106763929398082171217870421053986702009355855535129786260850675383419648681127018158100775558533952949402381637753162134550874268417162202985795686214400585039764184003031446966858170110874690477358...
result:
ok 20 tokens
Test #5:
score: 0
Accepted
time: 8ms
memory: 3540kb
input:
91120 20 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
inf 79720591846983829206255887296207669486915366790122276434980101585360431827746713261002508648352372575865363390100523993630288523905911853973318127707889991724762296859274660492425147944952897963807830595800561901914978699828863421552748209566274991181115114248717641246059782816631387147071628022...
result:
ok 20 tokens
Subtask #2:
score: 9
Accepted
Test #6:
score: 9
Accepted
time: 2ms
memory: 3044kb
input:
10 19 0000000000 2 241 1 405 1 927 1 669 1 734 1 349 2 493 1 828 1 385 1 855 2 761 1 63 1 288 1 754 2 91 1 863 2 805 2 1000 1 1000
output:
241 405 927 669 734 349 493 828 385 855 761 63 288 754 91 863 805 1000 1000
result:
ok 19 tokens
Test #7:
score: 0
Accepted
time: 2ms
memory: 3076kb
input:
10 20 1111111111 2 112 2 917 1 364 1 898 1 37 2 456 2 839 1 414 1 13 1 858 2 49 2 653 2 502 1 562 1 138 2 559 2 778 2 494 2 1000 1 1000
output:
112 917 364 898 37 456 839 414 13 858 49 653 502 562 138 559 778 494 1000 1000
result:
ok 20 tokens
Test #8:
score: 0
Accepted
time: 2ms
memory: 3040kb
input:
10 20 1000000001 1 490 1 300 2 143 2 151 2 665 1 539 2 412 2 160 1 377 1 2 2 730 2 724 1 99 1 242 1 824 1 448 2 171 1 355 2 1000 1 1000
output:
1951 1191 73 40 inf 1612 139 inf 1501 2 inf 725 292 722 3291 893 44 354 inf 3991
result:
ok 20 tokens
Test #9:
score: 0
Accepted
time: 1ms
memory: 2980kb
input:
10 19 1101011111 2 84 2 777 1 278 1 396 1 795 2 487 1 102 1 408 2 502 1 786 1 419 1 431 1 722 1 826 2 66 1 545 2 334 2 1000 1 1000
output:
inf inf 1842 2632 5292 inf 672 2712 77 5232 2782 2862 4802 2751 inf 3622 inf inf 3331
result:
ok 19 tokens
Test #10:
score: 0
Accepted
time: 2ms
memory: 3196kb
input:
10 19 0101001111 1 718 1 477 2 994 2 205 2 432 2 650 1 358 2 497 2 22 1 549 1 506 2 856 2 564 1 891 2 2 1 970 1 211 2 1000 1 1000
output:
7180 4770 inf inf inf 65 3580 inf inf 5490 5060 inf inf 8910 inf 9700 2110 100 10000
result:
ok 19 tokens
Test #11:
score: 0
Accepted
time: 2ms
memory: 2996kb
input:
10 20 1000000000 2 219 2 205 1 392 2 750 2 415 1 768 1 997 2 833 1 354 1 565 2 106 2 552 2 336 1 865 1 319 1 343 1 576 2 945 2 1000 1 1000
output:
982 185 435 inf 374 1193 886 538 237 377 119 314 378 577 424 533 1151 851 inf 667
result:
ok 20 tokens
Test #12:
score: 0
Accepted
time: 2ms
memory: 3200kb
input:
8 20 11110110 2 831 1 724 2 234 2 180 2 86 1 419 2 862 2 587 2 393 1 169 2 606 1 370 1 555 1 498 1 222 1 321 1 142 2 698 2 1000 1 1000
output:
555 1444 234 92 86 627 862 392 785 85 606 370 831 498 222 161 142 698 inf 1499
result:
ok 20 tokens
Test #13:
score: 0
Accepted
time: 2ms
memory: 3072kb
input:
10 20 1011111111 1 204 2 208 2 915 1 290 2 331 2 426 1 685 1 744 2 374 2 28 2 832 2 72 1 264 2 93 1 791 1 995 2 687 2 715 2 1000 1 1000
output:
2031 inf inf 2891 34 inf 6841 7431 inf inf inf inf 2631 inf 7901 9941 inf inf inf 9991
result:
ok 20 tokens
Test #14:
score: 0
Accepted
time: 2ms
memory: 2984kb
input:
10 19 0100100010 1 316 2 321 2 229 1 947 1 734 1 656 2 42 2 467 2 729 2 414 2 146 2 766 2 514 2 218 1 757 2 279 1 980 2 1000 1 1000
output:
842 inf 115 3155 2445 2185 16 inf 365 inf 109 574 inf inf 2515 140 1959 inf 1999
result:
ok 19 tokens
Test #15:
score: 0
Accepted
time: 1ms
memory: 3036kb
input:
10 20 1000110010 2 132 2 288 1 716 2 939 2 146 1 354 2 313 1 214 2 291 1 710 2 109 1 142 1 266 1 339 1 180 1 259 2 717 1 17 2 1000 1 1000
output:
132 inf 2146 470 49 1061 inf 641 98 1419 55 142 796 1016 359 776 717 17 inf 1999
result:
ok 20 tokens
Subtask #3:
score: 0
Wrong Answer
Dependency #2:
100%
Accepted
Test #16:
score: 9
Accepted
time: 5ms
memory: 3668kb
input:
96819 19 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
699771300 861286816 747345185 309822250 669300879 348051855 803856551 917004158 48514529 943411183 678753546 100896344 42516464 542123409 541302510 128941120 763029472 1000000000 1000000000
result:
ok 19 tokens
Test #17:
score: 0
Accepted
time: 5ms
memory: 3644kb
input:
92557 20 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
509322688 996739600 89495790 998716029 312248924 559737383 457422881 953859671 572963358 856570461 762291264 223198547 58794243 173324132 835097014 155380135 848188162 222373530 1000000000 1000000000
result:
ok 20 tokens
Test #18:
score: 0
Accepted
time: 216ms
memory: 3500kb
input:
95516 19 101000010010000010100000010010000000001010000000100101011100110001001011000010000100000000100010000001010000000000001000010000000110010000000010001001000010001000000000001000110000000000001001000000000100100000010010101000100001100010100010000100000001010000010110000110000010000000000000010...
output:
1475811523 102935175 inf 4020340896 inf inf 5281420809 128315171 6194844474 1550373923 1520505611 inf inf 2426181408 inf inf 103627765 inf 3144469321
result:
ok 19 tokens
Test #19:
score: 0
Accepted
time: 466ms
memory: 3528kb
input:
99156 19 110011010101010100010000100110100100011010010101011000001000001100101000110101010101110001100100001010001001101111110101010111100000111101100101001000011000010100000100000110110011001000110000010001001110000000111110001111101110100000100010000010101011010101101011100100000110010001000110000...
output:
496345169 557032445 inf 887831302 398188831 3952809443 300475786 1292382458 1145629458 inf 3329812970 inf 2479850232 24067569 223285773 601460773 inf inf 3297788268
result:
ok 19 tokens
Test #20:
score: 0
Accepted
time: 4ms
memory: 3508kb
input:
94938 20 000001000010000010000001010000000000010100011011000000000000010100000000100010000010100000000000010000111000000100010010000100001001011000010000000000100011010000100110100010000000000010010010000000000101100011000000011000000100000000011100001000001111000011101000100001000010010000001000010...
output:
inf inf 82950030446844 inf 18347742184128 inf 35361371066334 86032879778088 46232511253602 inf 53060573069676 27934434175290 40306080085614 inf inf 29324315387544 40376168064114 inf inf 94938000000000
result:
ok 20 tokens
Test #21:
score: 0
Accepted
time: 851ms
memory: 3596kb
input:
98383 19 111111111111101111111111111101111111111111101111111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111110111111111111111111111111111111111111111111111111011110111111111111111111111111110110111111010111111111111111111101111111111111111110111111111111111111...
output:
1414537126 251822729 830542751 281752282 1198787193 499855054 1326252716 10322399 1101854792 18253665354 352537582 10994082382 1141649895 1016763700 477276384 662099438 1114010593 8246040944 1306137259
result:
ok 19 tokens
Test #22:
score: 0
Accepted
time: 933ms
memory: 3480kb
input:
99995 19 101100110011000100110010011010001001101110011000100010100101110100000010101110100000111100001101101001000010110110111011010010100110100000000000101100010100101100011000110101110001110101100001001000010001100100111110001111100001001110111011100001000101011000010001110101100011011000010100001...
output:
1068175658 944686770 22235106 657045340 1502184933 121349463 1014525247 112751028 54232588 695983245 160240175 909343279 952427934 188856909 1465320003 2392294508 4341285759 2499286539 1391886583
result:
ok 19 tokens
Test #23:
score: -9
Wrong Answer
time: 88ms
memory: 3492kb
input:
91670 19 101111111111110111111111001111111111111111111111111110111111111111011111111111110111111111110111111111111011111111111101111111111111011111111111101111111111111011111111111011111011111111111111111011111111101111111111111111101101111111111111111111111101111111111111011111111111011111111111101...
output:
inf 10825073740 10666530035 22886984864 inf inf inf inf inf 6314703826 inf 6124309155 11751587987 5800535998 inf 9837162679 2896666042 inf 15627315217
result:
wrong answer 2nd words differ - expected: '14988563640', found: '10825073740'
Subtask #4:
score: 13
Accepted
Test #26:
score: 13
Accepted
time: 8ms
memory: 3536kb
input:
91666 20 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
515706124162066910404299759270263525075572767596736003465355923316260588149010617187359188941516324390245173109156994742981144311903350592651694874773059936377465166504183446390352558958540404515986128670780159685531688747924073414308447680356209302719213735419339034163216206854876449919662582900737...
result:
ok 20 tokens
Test #27:
score: 0
Accepted
time: 5ms
memory: 3580kb
input:
91047 20 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
748490273573792980373170496345932289792264023510501461386640731746530837775985011360693655655538352612548991850863544262166372647195373109391450350236987371183192812616376657263677465623740226504269832462386067930101999093116909436323318899728117997747067096632539706580241112266144163828519249301668...
result:
ok 20 tokens
Test #28:
score: 0
Accepted
time: 14ms
memory: 3548kb
input:
92486 19 110100000000000000110000000000100000000000000011000001001000010000010000000000100100001000000001101000000001011100000100010000000000000010000010001001000000000000000000000010000010001101000000001010010010000001000000110001100110000100101100001001100100100000000000010000000000000001010110000...
output:
inf inf inf inf inf inf inf inf inf inf 65986075054599739720012701630831185271110376577710956354155795249031175809009390746092705206288087294293403254292953327740384132264386725134793857054678394086844847065095541776644414503257258213388206060729019472813862535764008464101493529685679752732762570081...
result:
ok 19 tokens
Test #29:
score: 0
Accepted
time: 14ms
memory: 3576kb
input:
90758 19 111001110101010111100000111111011011001010101101110101111111101000011100011111111010111111010110011111001010111111101110101110010110110111000011110110111001100100001010011001010001110111011110111111111101110110111001101110101100111010010111100011000101101110011011111101110111100011110111111...
output:
337152640595339377254913355446254892275950588290486782075348462146043348153437383075163218482882384949983968092847114987978727985457664584745249748842150893129020441591183196333370705055984869426758646982814357613345456867523827515149962034146732136117858448360902802565799798832441703259791269764809...
result:
ok 19 tokens
Test #30:
score: 0
Accepted
time: 2ms
memory: 3424kb
input:
95944 20 010111110111111111001111111111101111111011111011011101101110111111111101101111111111111111111111111111101011011110111111111111111111111111111110111101111111110111101110011111111111111111111101101101101111111111110110111111101111111101101111111101111111111111111111101111111111110100011101111...
output:
inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf
result:
ok 20 tokens
Test #31:
score: 0
Accepted
time: 83ms
memory: 3604kb
input:
92585 20 110011011000101000000101010010100000000100000001110010010001100110001000100000100100000000111110001000000001000001100000110001001010000000101100000010100100001011010000001100000011000100011001000100000010010100001101000001110100001000011100010110100000100000101000010000000101000000100010010...
output:
693151164353298294991771915092246165588784011427723401514863569537180974110856679276502848848450095232556023520581621103706505329485541531644093395334224709813099430572342689943389061768308122334167396889122558885489842353859845505679740760989001467096316722773918455965593584892515339969002792035902...
result:
ok 20 tokens
Test #32:
score: 0
Accepted
time: 72ms
memory: 3576kb
input:
100000 19 11010101011011001011010111100000010010101100101010111000101110101001010110011011010011100100011110010011010011110111000100110000001111110010101000011111010011011101001100000000101011110100100100101100101010101100110111010011000101110111010110101000010110001010111110001010110100110000001111...
output:
171664461199134562766995650684440673085489422465326109270356812483138547934706911599756894207664574188038519627617045518815980608296136814038903827336872029429200125283024307872759381900102481215772231730929597377309317705827303189555946879704202361491952110134028530508207284059394040436511100411837...
result:
ok 19 tokens
Test #33:
score: 0
Accepted
time: 14ms
memory: 3496kb
input:
90139 20 101101100100111111111011100111110110111001111101101101110111011101011100111110111010110111101110110111101011011101100111110111011011101101110111101011011101101110101111101011101100111110101111011101101110110101111001111101101110110011111011101110110110111001101111101110011111011011101101110...
output:
114295361082305127942208281911086652195193612036965258194540554839765604416562780276165239338044991656166078586296137971810820270121979910956362520343058615413830387682572956846149751679906531190159869196033901257029539803703475752647797700268137583373220831250186514085304302366054423749897416545653...
result:
ok 20 tokens
Test #34:
score: 0
Accepted
time: 4ms
memory: 3540kb
input:
98059 19 101111111111111111011011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101111111111111111111111111111111111111111111111111111111111111111111011111111111111111...
output:
inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf
result:
ok 19 tokens
Test #35:
score: 0
Accepted
time: 13ms
memory: 3508kb
input:
90139 20 101101100100111111111011100111110110111001111101101101110111011101011100111110111010110111101110110111101011011101100111110111011011101101110111101011011101101110101111101011101100111110101111011101101110110101111001111101101110110011111011101110110110111001101111101110011111011011101101110...
output:
114295361082305127942208281911086652195193612036965258194540554839765604416562780276165239338044991656166078586296137971810820270121979910956362520343058615413830387682572956846149751679906531190159869196033901257029539803703475752647797700268137583373220831250186514085304302366054423749897416545653...
result:
ok 20 tokens
Subtask #5:
score: 0
Runtime Error
Test #36:
score: 0
Runtime Error
input:
98506 19 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
129925218195110981928395603118620127370928987146661525428495695586166441747122093986633381663949018340767091695255765965383300189018270134867014350559130786488843071697388697629880544282189724796656061147120839501796085974192680677594715705534842173371362779820511889417967125799617139889557622193947...
result:
Subtask #6:
score: 18
Accepted
Dependency #2:
100%
Accepted
Test #41:
score: 18
Accepted
time: 3ms
memory: 3096kb
input:
190 19 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 2 3030536584264275991656446184192931032142342202853788773124469117132936126944321526393387980895665026...
output:
303053658426427599165644618419293103214234220285378877312446911713293612694432152639338798089566502665575779543814797512740930993972387315159956432349381665458354645284037027514891865835605478519158667178660184697604213917963871214214812993111821807966534988024828960583750304242594098806161798042315...
result:
ok 19 tokens
Test #42:
score: 0
Accepted
time: 0ms
memory: 3144kb
input:
193 19 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1 1351772618151481423230177086652803238158508064486406797357216616385709633380157485598761110616759...
output:
135177261815148142323017708665280323815850806448640679735721661638570963338015748559876111061675986698273716658276773734390827561113116964538186189052478876635588737990551692498234494057058003059839751209829199035845447832974080800145478641135936706193078823264491086923999420322165582774203161595102...
result:
ok 19 tokens
Test #43:
score: 0
Accepted
time: 6ms
memory: 3232kb
input:
190 19 0000000011010110000100000000010000000000000000000100010000000000000000010100000111000001010000000011000001000000000000000000000000010010110101000011000000000000100000000000000000000000010010 1 7025546092138551598322506344609083764370337686180747350121879133435593878050481996018963226269128116...
output:
121066315045921793195200592070648049655182238067889414547155845804375798542180628895704193688487901135863687255971248858541143901463046375455959397730944384192574836173285774465365427926461293985125013936864584936350168615280937114979940883153218796189556449143484390864297448295233235970026936487842...
result:
ok 19 tokens
Test #44:
score: 0
Accepted
time: 6ms
memory: 3152kb
input:
192 20 110000000000000000011000010000110111001100000010100010001001101110000100100011001011000001000000001001001001010000000100010000100010000000000010010111000000000000001000001110100100110001100100 2 51479842325970730010319087287497995149596274445858463282007641826381091860094358712133023804622138...
output:
inf 38341998613194711610851598392376329213398429862236791722758429828646326206870946489490519963026620278136704108955473770401179989284259951741936057704130095473505373978595010127371825804565979665889636708149937481617973071629996787507036030381953952077912690620515217533760857971046867181877030987...
result:
ok 20 tokens
Test #45:
score: 0
Accepted
time: 1ms
memory: 3152kb
input:
196 20 0000001000111101011010100011000010000101011011110010010001001000100111000101100101001111001010010011000100000111110110001101001010100000101101110100100000001000011101111101010000100111011000101011 1 5015320864439209304113353314551060919088155080394686712838786263814988191390498501749844810680...
output:
983002889430085023606217249652007940141278395757358595716402107707737685512537706342969582893376081409407560680631350221655106602096322436309682564428967871040525844907753791470991421295721108784719338314023419167873478652184575613811169808572719480004991417722134184854576650304466492357556422463891...
result:
ok 20 tokens
Test #46:
score: 0
Accepted
time: 7ms
memory: 3084kb
input:
194 20 11011011110101101111101100110110101101111111011000111110111101111111111110101101111100111000100101111111100101011100110100011001010110011111101011110101111101011101010111001010011100100011101010 1 841496047844694106271899368968881221632199488715438957442647728849671943144930052559312457648223...
output:
891504250247790381112709236090289423357957492080039511773428701730686930228377839982132933854757846565323633322867282290995678030292425283974968227167227130246366960144042655498999943869557004317637813542338734912429234258824024567967120930328757422981159724306506145045239740956838608794789118224561...
result:
ok 20 tokens
Test #47:
score: 0
Accepted
time: 7ms
memory: 3152kb
input:
198 19 100110000110000111000000110000110010010100100011000000100110100010011110000000000100101100010011100000001000110100100000101000100100111010010000001000101000101001000100100100100110001000100101001000 2 35268317002431184701422245442405829000005923579945992741874795798460235954723010375715676030...
output:
188097690679632985074251975692831088000031592426378627956665577591787925091856055337150272161223232461075499593059212126413825718672976251812558867468696130695110574802879014919091206063605134554089047800467112022986558512528893907722423493493816444748847965076074729184451781829746238206659222584006...
result:
ok 19 tokens
Test #48:
score: 0
Accepted
time: 1ms
memory: 3236kb
input:
199 20 1000100010001000110000000010100010001000100010001000100010000100110000001000100010001000100010001100000010001000101000001000110000001000100010001000100001001000100010001000100010000010100100001000010 2 9920712460050181008040669786206611702734689138566783308194618736710864209338567704897309905...
output:
137780749052581345532524628751902126097653251792532398834285816751681663108339027610100202261210293919458371492650808877579565823149430999460191591192171578233591292569082476673858256583027045372506280728359601893043627060360779272172294102411578650200602856181121172884178186372659597881229494321504...
result:
ok 20 tokens
Test #49:
score: 0
Accepted
time: 4ms
memory: 3084kb
input:
191 20 10111111111111111111111111111111111111111111111110111111111111111111111111111111111111111111111110111111111111111111111111111111111111111111111101111111111111111111111111111111111111111111111 2 708525660737406064209605877955610699402495358097794658985099436654795878211525631427013176482016048...
output:
inf inf 4764927063424643385341316766894784077864447120347285019511038095835913836667468759882261308236894726769820585012982456865154319735565724505528756774276804286509553413096771267207786515671233882308497257886626356998534713361777345209974300706236027393518835957128358317338182290033572959471779...
result:
ok 20 tokens
Test #50:
score: 0
Accepted
time: 3ms
memory: 3108kb
input:
196 20 0101010100101010000110101010010101001010101001010100011001010111000010100110100010101001010010101010010100101010001101001001101010010001100110010110001010100101010010100101010010101001001101000110 1 3551825666225435715140441769407013363202718798956997020423487134473591163156979354572547081663...
output:
106690855261331095811115185717053581484710020627673780230345360667712470188316927738884172874481020065642522790344535637340588417934807971310354266142919040154634601403517324924829231747161526173417648078520507237523392804966603166147332292447888965648407387232298106862685661916582343133108491410284...
result:
ok 20 tokens
Subtask #7:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
0%