QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#425827 | #7279. Tricks of the Trade | Lynkcat# | 10 | 261ms | 205860kb | C++20 | 5.4kb | 2024-05-30 17:19:57 | 2024-05-30 17:20:01 |
Judging History
answer
#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
#define sz(x) ((int)((x).size()))
#define int ll
// #define N
using namespace std;
const int N=250005;
int cnt;
struct node
{
int x,y,ls,rs;
}tr[N*64];
int n,K;
int m;
int a[N],b[N],v[N][3];
int pos[N];
int rt[N];
poly g;
poly I[N],E[N];
poly ins[N],ers[N];
int vis[N];
int from[N],from1[N];
int update(int u,int l,int r,int L,int x,int y)
{
int k=++cnt;
tr[k]=tr[u];
tr[k].x+=x;
tr[k].y+=y;
if (l==r) return k;
int mid=l+(r-l)/2;
if (L<=mid) tr[k].ls=update(tr[u].ls,l,mid,L,x,y);
else tr[k].rs=update(tr[u].rs,mid+1,r,L,x,y);
return k;
}
int Mn,Sum;
void qry(int kr,int kl,int l,int r,int k)
{
if (l==r)
{
Mn=l;
Sum+=k*g[l-1];
return;
}
int mid=l+(r-l)/2;
int rt=tr[tr[kr].rs].x-tr[tr[kl].rs].x;
if (k>rt)
{
Sum+=tr[tr[kr].rs].y-tr[tr[kl].rs].y;
qry(tr[kr].ls,tr[kl].ls,l,mid,k-rt);
} else
{
qry(tr[kr].rs,tr[kl].rs,mid+1,r,k);
}
}
int trans(int i,int j)
{
if (j-i-1>=K-2)
{
Mn=sz(g)+1,Sum=0;
if (K-2)
qry(rt[j-1],rt[i],1,m,K-2);
Mn--;
if (Mn<sz(g)) Mn=g[Mn]; else Mn=inf;
return Sum+v[j][2]+v[i][0];
}
return -inf;
}
void solve(int l,int r,int L,int R)
{
if (l==r)
{
for (int i=L;i<=R;i++) from[i]=l;
return;
}
if (L>R) return;
int mid=L+(R-L)/2;
int pos=l,lstv=trans(l,mid);
for (int i=l;i<mid&mid-i-1>=K-2&&i<=r;i++)
{
int nv=trans(i,mid);
if (nv>=lstv)
{
pos=i;
lstv=nv;
}
}
from[mid]=pos;
solve(l,pos,L,mid-1);
solve(pos,r,mid+1,R);
}
void solve1(int l,int r,int L,int R)
{
if (l==r)
{
for (int i=L;i<=R;i++) from1[i]=l;
return;
}
if (L>R) return;
int mid=L+(R-L)/2;
int pos=l,lstv=trans(l,mid);
for (int i=l;i<mid&mid-i-1>=K-2&&i<=r;i++)
{
int nv=trans(i,mid);
if (nv>lstv)
{
pos=i;
lstv=nv;
}
}
from1[mid]=pos;
solve1(l,pos,L,mid-1);
solve1(pos,r,mid+1,R);
}
int lst_oc[N],fst_oc[N];
void BellaKira()
{
cin>>n>>K;
for (int i=1;i<=n;i++)
cin>>a[i],a[i]+=a[i-1];
for (int i=1;i<=n;i++)
cin>>b[i];
for (int i=1;i<=n;i++)
{
v[i][0]=b[i]+a[i-1];
v[i][1]=b[i];
v[i][2]=b[i]-a[i];
}
if (K==1)
{
int mn=inf;
for (int i=1;i<=n;i++) mn=min(mn,b[i]-a[i]+a[i-1]);
cout<<mn<<'\n';
for (int i=1;i<=n;i++)
if (b[i]-a[i]+a[i-1]==mn) cout<<1;
else cout<<0;
cout<<'\n';
return;
}
for (int i=1;i<=n;i++)
{
g.push_back(v[i][1]);
}
sort(g.begin(),g.end());
g.erase(unique(g.begin(),g.end()),g.end());
for (int i=1;i<=n;i++)
{
pos[i]=lower_bound(g.begin(),g.end(),v[i][1])-g.begin()+1;
}
m=sz(g);
for (int i=1;i<=n;i++)
{
rt[i]=rt[i-1];
rt[i]=update(rt[i],1,m,pos[i],1,v[i][1]);
}
int ans=-inf;
int lst=1;
solve(1,n,2,n);
solve1(1,n,2,n);
map<int,int>mmp;
mmp[v[1][0]]=1;
fst_oc[1]=1;
for (int j=2;j<=n;j++)
{
lst_oc[j]=mmp[v[j][0]];
if (lst_oc[j]) fst_oc[j]=fst_oc[lst_oc[j]];
else fst_oc[j]=j;
mmp[v[j][0]]=j;
ans=max(ans,trans(from[j],j));
}
for (int i=1,j=1;i<=n;i++)
{
j=max(j,i+1);
while (j<=n&&from1[j]<=i) j++;
int l=i+1,r=j-1;
int nl=j;
while (l<=r)
{
int mid=l+(r-l)/2;
if (trans(i,mid)==trans(from[mid],mid))
{
nl=mid;
r=mid-1;
} else l=mid+1;
}
//[nl,j-1]
// cout<<i<<" "<<nl<<" "<<j-1<<endl;
ins[nl].push_back(i);
ers[j].push_back(i);
}
multiset<int>S;
for (int i=1;i<=n;i++)
{
for (auto u:ins[i])
{
S.insert(u);
}
for (auto u:ers[i])
{
if (S.find(u)!=S.end())
S.erase(u);
}
if (trans(from[i],i)==ans)
{
// cout<<"!!!"<<i<<" "<<from1[i]<<" "<<from[i]<<endl;
I[from[i]].push_back(Mn);
E[i].push_back(Mn);
for (auto u:S)
{
trans(u,i);
I[u].push_back(Mn);
E[i].push_back(Mn);
vis[u]|=2;
vis[i]|=1;
}
S.clear();
}
}
S.clear();
for (int i=1;i<=n;i++)
{
for (auto u:I[i]) S.insert(u);
for (auto u:E[i]) S.erase(S.find(u));
if (S.size()&&v[i][1]>=(*S.begin())) vis[i]|=1;
}
cout<<ans<<'\n';
for (int i=1;i<=n;i++) cout<<(vis[i]>0);
cout<<'\n';
}
signed main()
{
IOS;
cin.tie(0);
int T=1;
while (T--)
{
BellaKira();
}
}
/*list:
1.mod 998244353 or 1e9+7 or ???
2.N
3.duipai shuju xingtai duoyidian
...
*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 5
Acceptable Answer
Test #1:
score: 10
Accepted
time: 0ms
memory: 22020kb
input:
5 3 3 5 2 3 6 2 1 5 2 3
output:
-1 00111
result:
ok all correct
Test #2:
score: 10
Accepted
time: 2ms
memory: 22108kb
input:
200 40 81 50 87 91 54 1 77 68 19 84 28 81 45 64 4 13 25 89 12808135 86 40 73 47 18 82 79 11 96 16 34 80 36 8 5 60 76 86 84 36 37 96 55 68 12807879 51 89 57 30 100 11 44 19 96 32 9 68 41 12808009 5 58 12807939 92 68 67 78 32 57 49 71 92 64 35 89 76 81 36 6 6 53 31 85 79 5 85 1 91 17 37 25 91 54 29 47...
output:
12807909 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111000000000000000000000000000000000000
result:
ok all correct
Test #3:
score: 5
Acceptable Answer
time: 0ms
memory: 22360kb
input:
200 41 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
81 11111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111110000000
result:
points 0.50 first question correct
Test #4:
score: 5
Acceptable Answer
time: 2ms
memory: 17924kb
input:
5 2 1 6 1 5 2 4 1 6 2 4
output:
2 10110
result:
points 0.50 first question correct
Test #5:
score: 10
Accepted
time: 0ms
memory: 22308kb
input:
7 3 5 1 1 1 1 1 5 1 1 1 1 1 1 1
output:
0 0111110
result:
ok all correct
Test #6:
score: 10
Accepted
time: 0ms
memory: 20064kb
input:
200 100 142654162 64490063 513345044 219974445 84112685 711899650 33120992 176027514 802361343 2414916 941549932 786288853 94273368 829024564 352947721 355629698 903479794 326383768 720620114 271371691 786997028 138881060 711795174 536092340 290169962 938690480 710723910 231424065 468554799 44519400...
output:
-2461503019 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111011111111111111111111111111111111111111111111111111111111111111111111111111111110
result:
ok all correct
Test #7:
score: 10
Accepted
time: 2ms
memory: 22140kb
input:
200 199 392097713 864387769 236976435 989793783 997090826 107508554 219275702 329027733 181833481 896113693 791833669 652173288 689106070 645879177 369017772 739620594 465647432 361649152 704125516 383540722 576805937 293955811 610328615 867720036 757212267 369257718 556736284 696523840 140108544 86...
output:
-105367042470 01111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
result:
ok all correct
Test #8:
score: 5
Acceptable Answer
time: 3ms
memory: 20064kb
input:
200 3 746 47 728 416 642 210 910 989 579 230 210 69 492 889 382 557 765 799 530 654 409 580 142 660 984 564 669 995 761 37 626 486 787 448 702 896 828 141 506 819 513 930 633 306 458 592 317 358 1 399964794 122 33 989 530 924 440 783 752 486 723 756 383 521 710 203 880 43 938 619 108 312 627 838 897...
output:
700075000 00000001111011111000000010000000000000000000000000110011000100001010101100000001100000000000000000000110000010000001110000001010000000000000000000000000100100110000100110110000010010000000000000000000
result:
points 0.50 first question correct
Test #9:
score: 5
Acceptable Answer
time: 0ms
memory: 22308kb
input:
200 50 880 306 671 420 987 969 816 443 151 370 474 369 971 785 908 523 671 790 123 453 578 788 484 883 451 352 182 605 216 157 129 401 879 201 308 556 580 479 696 481 20 785 109 138 893 293 779 549 745 93 611 656 380 571 634 483 565 882 375 941 632 813 224 65 446 920 825 720 497 861 267 128 449 332 ...
output:
778903 11111111111111111111111111111111111111110101101010000011110110110011101111111011111001111111111101111111111110111111101111100000111111000000111111111011111011111101111111110110111101111111111101111000
result:
points 0.50 first question correct
Test #10:
score: 5
Acceptable Answer
time: 0ms
memory: 22280kb
input:
200 88 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
114 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110
result:
points 0.50 first question correct
Test #11:
score: 10
Accepted
time: 2ms
memory: 22108kb
input:
200 66 38 28 65 41 3 16 72 66 3 23 24 68 2 11 80 18 66 24 10 25 73 86 84 40 67 21 30 90 2 9 21 3 19 59 43 90 82 35 26 38 60 27 63 41 56 44 30 95 77 15 87 49 90 80 43 3 27 55 64 26 14 84 99 53 18 28 2 92 12 58 28 56 66 83 21 2 14 91 88 60 61 67 18 92 42 39 52 5 17 74 9 61 25 39 29 36 72 30 57 48 67 9...
output:
676940628 11111111111111111111111111011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110111111000000000000000000000000000000000000000000000000000000000000000000010
result:
ok all correct
Subtask #2:
score: 5
Acceptable Answer
Dependency #1:
50%
Acceptable Answer
Test #12:
score: 10
Accepted
time: 2ms
memory: 17960kb
input:
5 3 3 5 2 3 6 2 1 5 2 3
output:
-1 00111
result:
ok all correct
Test #13:
score: 10
Accepted
time: 0ms
memory: 22148kb
input:
200 40 81 50 87 91 54 1 77 68 19 84 28 81 45 64 4 13 25 89 12808135 86 40 73 47 18 82 79 11 96 16 34 80 36 8 5 60 76 86 84 36 37 96 55 68 12807879 51 89 57 30 100 11 44 19 96 32 9 68 41 12808009 5 58 12807939 92 68 67 78 32 57 49 71 92 64 35 89 76 81 36 6 6 53 31 85 79 5 85 1 91 17 37 25 91 54 29 47...
output:
12807909 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111000000000000000000000000000000000000
result:
ok all correct
Test #14:
score: 5
Acceptable Answer
time: 0ms
memory: 20104kb
input:
200 41 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
81 11111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111110000000
result:
points 0.50 first question correct
Test #15:
score: 10
Accepted
time: 6ms
memory: 25456kb
input:
6000 5999 438826959 520928239 904033734 666301250 559942226 360928183 64116981 707910123 172582807 906896526 260719797 854677975 121544450 575670562 394652708 155768149 22161417 359291091 499618825 502667952 59650494 257306042 963408276 303083778 352667915 75773679 278285664 105026391 349323928 2277...
output:
-2974920497008 011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok all correct
Test #16:
score: 5
Acceptable Answer
time: 20ms
memory: 24900kb
input:
6000 3 755 139 542 981 834 378 403 50 957 642 422 97 404 162 96 740 382 555 165 341 975 495 798 239 400 995 990 658 164 147 322 347 326 992 571 206 738 409 984 474 92 827 491 900 714 702 236 938 524 980 661 142 161 150 960 110 248 44 856 823 312 191 26 474 761 862 602 329 729 230 994 370 959 693 648...
output:
700075000 00100000110000010011000101010010110010000010110111010010000000001010101111000100001100100010001010000000000000101000001000001001111001111001110101011001010100001100101000010110011001100100000001000011000000010011010110010001001000000001111010101110010101111110000010000000000111011000101011...
result:
points 0.50 first question correct
Test #17:
score: 5
Acceptable Answer
time: 16ms
memory: 27072kb
input:
6000 1000 741 138 363 210 35 245 159 911 800 560 73 301 493 449 238 954 902 597 370 544 602 407 189 738 289 997 735 141 951 373 871 890 156 903 436 831 312 759 825 132 903 675 528 818 174 110 848 680 774 600 514 287 220 68 540 227 358 880 23 508 308 240 379 647 72 951 458 948 335 134 131 107 327 690...
output:
24611157 011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
points 0.50 first question correct
Test #18:
score: 5
Acceptable Answer
time: 12ms
memory: 25100kb
input:
6000 100 336 306 465 857 915 140 929 46 210 912 792 718 320 735 261 263 470 571 291 582 344 201 84 145 181 118 322 298 213 633 26 784 247 34 704 403 491 717 409 591 793 180 190 40 172 819 298 308 22 443 153 85 823 863 444 272 882 953 495 204 173 896 790 228 474 508 772 628 801 802 734 650 335 307 82...
output:
4154886 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
points 0.50 first question correct
Test #19:
score: 5
Acceptable Answer
time: 9ms
memory: 21080kb
input:
6000 2574 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
3428 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
points 0.50 first question correct
Test #20:
score: 10
Accepted
time: 4ms
memory: 23252kb
input:
6000 2 4 907464143 5 819 1 718 1 835 1 868 4 805 1 909 2 794 3 881 3 737 2 836 5 897 3 948 3 962 4 966 4 760 1 711 3 769 1 735 2 755 1 970 4 995 3 804 2 736 1 829 1 792 4 780 5 755 2 736 5 899 4 948 2 824 4 878 3 908 3 799 1 783 2 762 5 756 3 711 2 819 4 808 3 871 5 891 3 898 5 862 1 822 2 829 3 746...
output:
181 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
result:
ok all correct
Test #21:
score: 10
Accepted
time: 8ms
memory: 25340kb
input:
6000 3000 922052946 280904938 445918355 967683647 277202791 981735071 732175606 219768397 796109205 465645246 966784498 355162401 336770904 400156650 619935812 447153504 304935758 623511852 508900817 502590598 838660835 931490468 533176270 718616615 820952844 886312677 750600298 980271025 911406540 ...
output:
3600871 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
result:
ok all correct
Test #22:
score: 5
Acceptable Answer
time: 0ms
memory: 22012kb
input:
5 2 1 6 1 5 2 4 1 6 2 4
output:
2 10110
result:
points 0.50 first question correct
Test #23:
score: 10
Accepted
time: 5ms
memory: 22240kb
input:
7 3 5 1 1 1 1 1 5 1 1 1 1 1 1 1
output:
0 0111110
result:
ok all correct
Test #24:
score: 10
Accepted
time: 0ms
memory: 20064kb
input:
200 100 142654162 64490063 513345044 219974445 84112685 711899650 33120992 176027514 802361343 2414916 941549932 786288853 94273368 829024564 352947721 355629698 903479794 326383768 720620114 271371691 786997028 138881060 711795174 536092340 290169962 938690480 710723910 231424065 468554799 44519400...
output:
-2461503019 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111011111111111111111111111111111111111111111111111111111111111111111111111111111110
result:
ok all correct
Test #25:
score: 10
Accepted
time: 0ms
memory: 18012kb
input:
200 199 392097713 864387769 236976435 989793783 997090826 107508554 219275702 329027733 181833481 896113693 791833669 652173288 689106070 645879177 369017772 739620594 465647432 361649152 704125516 383540722 576805937 293955811 610328615 867720036 757212267 369257718 556736284 696523840 140108544 86...
output:
-105367042470 01111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
result:
ok all correct
Test #26:
score: 5
Acceptable Answer
time: 5ms
memory: 20264kb
input:
200 3 746 47 728 416 642 210 910 989 579 230 210 69 492 889 382 557 765 799 530 654 409 580 142 660 984 564 669 995 761 37 626 486 787 448 702 896 828 141 506 819 513 930 633 306 458 592 317 358 1 399964794 122 33 989 530 924 440 783 752 486 723 756 383 521 710 203 880 43 938 619 108 312 627 838 897...
output:
700075000 00000001111011111000000010000000000000000000000000110011000100001010101100000001100000000000000000000110000010000001110000001010000000000000000000000000100100110000100110110000010010000000000000000000
result:
points 0.50 first question correct
Test #27:
score: 5
Acceptable Answer
time: 0ms
memory: 22104kb
input:
200 50 880 306 671 420 987 969 816 443 151 370 474 369 971 785 908 523 671 790 123 453 578 788 484 883 451 352 182 605 216 157 129 401 879 201 308 556 580 479 696 481 20 785 109 138 893 293 779 549 745 93 611 656 380 571 634 483 565 882 375 941 632 813 224 65 446 920 825 720 497 861 267 128 449 332 ...
output:
778903 11111111111111111111111111111111111111110101101010000011110110110011101111111011111001111111111101111111111110111111101111100000111111000000111111111011111011111101111111110110111101111111111101111000
result:
points 0.50 first question correct
Test #28:
score: 5
Acceptable Answer
time: 2ms
memory: 22112kb
input:
200 88 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
114 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110
result:
points 0.50 first question correct
Test #29:
score: 10
Accepted
time: 0ms
memory: 22116kb
input:
200 66 38 28 65 41 3 16 72 66 3 23 24 68 2 11 80 18 66 24 10 25 73 86 84 40 67 21 30 90 2 9 21 3 19 59 43 90 82 35 26 38 60 27 63 41 56 44 30 95 77 15 87 49 90 80 43 3 27 55 64 26 14 84 99 53 18 28 2 92 12 58 28 56 66 83 21 2 14 91 88 60 61 67 18 92 42 39 52 5 17 74 9 61 25 39 29 36 72 30 57 48 67 9...
output:
676940628 11111111111111111111111111011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110111111000000000000000000000000000000000000000000000000000000000000000000010
result:
ok all correct
Subtask #3:
score: 0
Time Limit Exceeded
Test #30:
score: 5
Acceptable Answer
time: 2ms
memory: 22024kb
input:
5 2 1 6 1 5 2 4 1 6 2 4
output:
2 10110
result:
points 0.50 first question correct
Test #31:
score: 10
Accepted
time: 160ms
memory: 129260kb
input:
250000 2 18 35 29 35 18 610084694 18 35 29 35 18 448867144 18 35 29 35 18 971272498 18 35 29 35 18 890430190 18 35 29 35 18 655685684 18 35 29 35 18 234608237 18 35 29 35 18 894586749 18 35 29 35 18 442195168 18 35 29 35 18 341564617 18 35 29 35 18 985069087 18 35 29 35 18 967546483 18 35 29 35 18 5...
output:
33391 101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010...
result:
ok all correct
Test #32:
score: 10
Accepted
time: 163ms
memory: 99928kb
input:
250000 2 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1...
output:
7 0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101...
result:
ok all correct
Test #33:
score: 10
Accepted
time: 182ms
memory: 122240kb
input:
250000 2 296095839 339724373 965973329 196477261 344160630 150756369 190174474 470255817 512937857 249988555 752486830 474766981 101796731 563280029 312834955 720810905 619379033 324109033 874523062 841728664 19232878 363302361 436792441 201047597 165902785 728305993 892140052 423772401 255303346 35...
output:
-3196894 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
result:
ok all correct
Test #34:
score: 10
Accepted
time: 246ms
memory: 201572kb
input:
250000 2 376 997 143 229 156 268 727 677 546 358 90 640 60 769 719 690 109 34 216 522 884 609 280 765 605 31 666 831 484 182 600 682 689 103 409 421 455 587 971 442 575 402 788 246 270 255 158 582 281 259 935 578 210 439 432 480 86 273 323 929 326 699 379 298 880 163 169 125 773 857 654 902 177 163 ...
output:
127670228 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
result:
ok all correct
Test #35:
score: 5
Acceptable Answer
time: 261ms
memory: 204440kb
input:
250000 2 453 396 898 114 712 889 968 486 308 612 455 958 517 330 506 470 161 423 120 110 588 176 325 304 383 578 934 976 119 779 286 184 984 575 621 99 277 113 43 681 404 397 390 94 939 405 958 170 542 935 610 747 164 245 292 315 438 477 45 62 998 706 231 474 556 181 27 385 442 613 295 283 985 82 12...
output:
100000000 11101011010000000011100010011100010111101111011111100010101011101011110110100010001011011010001111110110101111100011010000110011111010000000000100110111001011011111111111001000010101000110111010011110111110100100010001011010100111110101100001111101111000010100101111100110010101010100011011...
result:
points 0.50 first question correct
Test #36:
score: 5
Acceptable Answer
time: 258ms
memory: 205800kb
input:
250000 2 301 561 538 318 354 945 677 821 949 896 280 109 987 299 572 657 669 85 613 459 859 434 188 160 481 989 838 383 851 560 479 712 880 696 362 755 229 159 220 650 527 237 690 314 415 808 998 637 643 844 980 619 33 949 433 710 761 934 469 429 209 492 566 846 876 371 619 930 335 380 357 611 528 9...
output:
100000000 00111000100000011011000100110101011101000100001000110111000001000000110101111101011101000111101001010100001111110100101110011101001000100101010110010010000100011011000001011010011101101111111111010111011010001010000100010011011011110100100010110111000001111001111101100011010101000111111111...
result:
points 0.50 first question correct
Test #37:
score: 10
Accepted
time: 249ms
memory: 205860kb
input:
250000 2 4 42 73 93 7 35 94 94 51 89 37 88 62 82 4 50 17 25 41 75 79 42 65 84 85 76 8 5 53 61 30 96 5 12 73 89 80 93 37 59 13 7 17 86 81 28 53 37 35 53 84 82 50 43 19 57 46 58 98 15 24 44 14 28 16 32 100 29 93 84 66 74 67 44 51 53 30 39 40 39 31 77 96 82 9 95 27 51 99 17 15 65 24 38 26 66 64 52 82 4...
output:
75103735 110001100101101001011000111101100010010100000101011100011010110100100100010110001001100110000000100100010010100000001001010111010000001010011010110100011100010110010010100110100111111100010110011101001011100000001010100101110001001110101110100001110010000010101010100011011010000011000000011...
result:
ok all correct
Test #38:
score: 0
Time Limit Exceeded
input:
250000 2 6 179605521 98 560489812 78 428728290 46 394467511 13 104828723 85 556581057 82 276557631 45 216804298 81 484579962 48 632665627 52 548050190 97 173641903 3 724257667 10 791131062 34 874026470 70 513926122 72 857542636 24 670114142 18 242541410 47 380039814 76 284051523 15 683070321 35 3191...
output:
result:
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
50%
Acceptable Answer
Dependency #2:
50%
Acceptable Answer
Dependency #3:
0%