QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#421155 | #8725. Train | _yjh | 100 ✓ | 914ms | 139128kb | C++14 | 5.8kb | 2024-05-25 14:21:05 | 2024-05-25 14:21:06 |
Judging History
answer
/*
Source
Start at
Finish at
AC at
*/
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef double db;
typedef vector <int> vi;
inline ll read() {
ll x=0,f=1;char ch=getchar();
while(!isdigit(ch)) {if(ch=='-')f=-1;ch=getchar();}
while(isdigit(ch)) {x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
return x*f;
}
const ll N=4e5+5,B=500,M=N/B+5,inf=1e18;
int n,m,w,up,cnt,id[N],bk[N],ys[N][2],lst_app[N];
int t[N],x[N],y[N],a[N],b[N],c[N],l[N],r[N];
ll dp[N];
map <int,int> mp,ex_mp;
struct B1 {
int L[N],R[N],blg[N];
ll sumB[M],sum[N];
int getB(int x) {
return x/B+1;
}
void init() {
for(int i=0;i<=up;i++) R[getB(i)]=i;
for(int i=up;i>=0;i--) L[getB(i)]=i;
for(int i=0;i<=up;i++) blg[i]=getB(i);
}
void upd(int x,ll val) {
for(int b=1;b<blg[x];b++) sumB[b]+=val;
for(int i=L[blg[x]];i<=x;i++) sum[i]+=val;
}
ll query(int x) {
return sumB[blg[x]]+sum[x];
}
}B1;
struct B2 {
int n;
vector <int> L,R,blg,lst,nxt,hd,q,vis;
vector <ll> a,lz,ex,cf;
int getB(int x) {
return (x+B-1)/B;
}
void build(int b) {
ll sum=0;
for(int i=R[b];i>=L[b];i--) {
sum+=ex[i],ex[i]=0,a[i]+=sum,vis[i]=false;
}
ll mn=a[R[b]];
for(int i=R[b];i>=L[b];i--) {
mn=min(mn,a[i]);
if(a[i]==mn) vis[i]=true,hd[b]=i;
}
lst[L[b]]=0;
for(int i=L[b]+1;i<=R[b];i++) {
if(vis[i-1]) lst[i]=i-1;
else lst[i]=lst[i-1];
}
nxt[R[b]]=0;
for(int i=R[b]-1;i>=L[b];i--) {
if(vis[i+1]) nxt[i]=i+1;
else nxt[i]=nxt[i+1];
}
cf[hd[b]]=a[hd[b]];
for(int i=L[b];i<=R[b];i++) if(vis[i]&&lst[i]) cf[i]=a[i]-a[lst[i]];
}
void reset(int x,ll val) {
ll sum=0;
for(int i=blg[n];i>=blg[x];i--) sum+=lz[i];
for(int i=R[blg[x]];i>=x;i--) sum+=ex[i];
if(val-sum>=a[x]) return ;
a[x]=val-sum;build(blg[x]);
}
void init(int sz) {
n=sz;a.resize(n+1,inf);q.resize(n+1);vis.resize(n+1);
L.resize(getB(n)+1),R.resize(getB(n)+1),hd.resize(getB(n)+1);
blg.resize(n+1);lst.resize(n+1),nxt.resize(n+1);
lz.resize(getB(n)+1),ex.resize(n+1),cf.resize(n+1);
for(int i=1;i<=n;i++) R[getB(i)]=i;
for(int i=n;i>=1;i--) L[getB(i)]=i;
for(int i=1;i<=n;i++) blg[i]=getB(i);
for(int b=1;b<=blg[n];b++) {
build(b);
}
}
void upd(int x,ll val) {
lz[blg[x]-1]+=val,ex[x]+=val,cf[hd[blg[x]]]+=val;
if(x==R[blg[x]]) return ;
cf[nxt[x]]-=val;
if(cf[nxt[x]]<0) build(blg[x]);
}
ll query() {
ll sum=0,ans=inf;
for(int b=blg[n];b>=1;b--) {
sum+=lz[b];
ans=min(ans,sum+cf[hd[b]]);
}
return ans;
}
}B2[M];
void lsh(vi vec) {
sort(vec.begin(),vec.end());
vec.resize(unique(vec.begin(),vec.end())-vec.begin());
for(int nw:vec) mp[nw]=++up;
}
vector <int> ed[N],st[N],rail[N],dish[N];
int ret[N],ver[N];
namespace CHT {
#define mid ((l+r)>>1)
struct Node {
#define lc(t) nd[t].lc
#define rc(t) nd[t].rc
#define val(t) nd[t].val
int lc,rc,val;
}nd[N<<5];
int nw,rt[N],tot;
void Upd(int t1,int t2,int l,int r,int p,int k) {
if(l==r) return val(t1)=k,void();
if(p<=mid) {
lc(t1)=++tot,rc(t1)=rc(t2);
Upd(lc(t1),lc(t2),l,mid,p,k);
}
else {
lc(t1)=lc(t2),rc(t1)=++tot;
Upd(rc(t1),rc(t2),mid+1,r,p,k);
}
}
int upd(int p,int k) {
// cerr<<"AbDSQIEOU(FHW(UFH"<<' '<<p<<' '<<k<<'\n';
rt[++nw]=++tot;
Upd(rt[nw],rt[nw-1],1,cnt,p,k);
return nw;
}
void Query(int t,int l,int r) {
if(l==r) return ret[l]=val(t),void();
Query(lc(t),l,mid);Query(rc(t),mid+1,r);
}
void query(int p) {
for(int i=1;i<=cnt;i++) ret[i]=0;
Query(rt[ver[p]],1,cnt);
}
#undef mid
}
ll solve(int N,int M,int W,vi T,vi X,vi Y,vi A,vi BB,vi C,vi L,vi R) {
n=N,m=M,w=W;
for(int i=1;i<=n;i++) t[i]=T[i-1];
for(int i=1;i<=m;i++) {
x[i]=X[i-1]+1,y[i]=Y[i-1]+1;
a[i]=A[i-1],b[i]=BB[i-1],c[i]=C[i-1];
ed[y[i]].push_back(i);st[x[i]].push_back(i);
}
for(int i=1;i<=n;i++) {
if(ed[i].size()>=B) {
id[i]=++cnt,bk[cnt]=i;
ex_mp.clear();
vi vec;int tmp=0;
for(int id:ed[i]) {
vec.push_back(b[id]);
}
for(int id:st[i]) {
vec.push_back(a[id]);
}
sort(vec.begin(),vec.end());
vec.resize(unique(vec.begin(),vec.end())-vec.begin());
for(int nw:vec) ex_mp[nw]=++tmp;
for(int id:ed[i]) {
ys[id][1]=ex_mp[b[id]];
}
for(int id:st[i]) {
ys[id][0]=ex_mp[a[id]];
}
B2[cnt].init(tmp);
}
}
for(int i=1;i<=w;i++) {
l[i]=L[i-1],r[i]=R[i-1];
}
vi vec;
for(int i=1;i<=m;i++) {
vec.push_back(a[i]),vec.push_back(b[i]);
}
for(int i=1;i<=w;i++) {
vec.push_back(l[i]),vec.push_back(r[i]);
}
lsh(vec);
for(int i=1;i<=m;i++) {
a[i]=mp[a[i]],b[i]=mp[b[i]];
rail[a[i]].push_back(-i);
rail[b[i]].push_back(i);
}
for(int i=1;i<=w;i++) {
l[i]=mp[l[i]],r[i]=mp[r[i]];
dish[r[i]].push_back(i);
}
for(int i=1;i<=m;i++) dp[i]=inf;
B1.init();
for(int i=1;i<=up;i++) {
sort(rail[i].begin(),rail[i].end());
reverse(rail[i].begin(),rail[i].end());
ver[i]=ver[i-1];
for(int nw:rail[i]) {
if(nw<0) {
nw=-nw;int fm=id[x[nw]];
if(x[nw]==1) {
dp[nw]=min(dp[nw],B1.query(0)*t[x[nw]]+c[nw]);
}
if(!fm) {
for(int lst:ed[x[nw]]) {
if(b[lst]>a[nw]) continue;
dp[nw]=min(dp[nw],dp[lst]+B1.query(b[lst])*t[x[nw]]+c[nw]);
}
}
else {
dp[nw]=min(dp[nw],B2[fm].query()+c[nw]);
ver[i]=CHT::upd(fm,ys[nw][0]);
}
}
else {
int fm=id[y[nw]];
if(!fm) continue;
B2[fm].reset(ys[nw][1],dp[nw]);
ver[i]=CHT::upd(fm,ys[nw][1]);
}
}
for(int nw:dish[i]) {
B1.upd(l[nw]-1,1);
if(!ver[l[nw]-1]) continue;
CHT::query(l[nw]-1);
for(int j=1;j<=cnt;j++) {
if(ret[j]) {
B2[j].upd(ret[j],t[bk[j]]);
}
}
}
}
ll ans=inf;
for(int i=1;i<=m;i++) {
if(y[i]==n) {
ans=min(ans,dp[i]+t[y[i]]*B1.query(b[i]));
}
}
return (ans>1e15?-1:ans);
}
详细
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 0ms
memory: 61572kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 50 1000 10 10105 31266 10364 11996 6694 1276 1677 8975 29590 13005 14834 4240 22849 10109 23051 26641 5284 29674 11338 12550 18414 18383 7820 27307 23293 31466 15273 32328 13448 12638 20041 9907 5022 8022 9722 28951 7503 12267 12928 15093 29353 4936 26988 20840 25318...
output:
sxhcnrtkowadcmssnrw4958scufufe45 36064
result:
ok 2 lines
Test #2:
score: 0
Accepted
time: 7ms
memory: 63304kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 1000 1000 10 10170 16858 7199 1742 16377 14274 31158 15966 32142 21116 11876 5121 6875 13356 8142 12954 17356 4962 15184 24291 17349 322 13204 3759 20440 23266 15460 1394 16700 27123 14524 6658 21498 30884 3876 2463 15850 23747 6204 31794 12766 15909 23449 7634 8989 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 -1
result:
ok 2 lines
Test #3:
score: 0
Accepted
time: 8ms
memory: 63404kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 200 1000 10 10186 5064 30984 23754 2414 1140 13953 1329 16396 23144 11137 5341 19265 30551 20799 1341 20374 31552 24338 10842 8890 12190 22742 6064 27919 13024 23699 18236 1128 30744 29529 14038 25618 28407 26990 28609 26129 26617 29100 11393 8619 2269 6180 4332 4907...
output:
sxhcnrtkowadcmssnrw4958scufufe45 -1
result:
ok 2 lines
Test #4:
score: 0
Accepted
time: 10ms
memory: 61268kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100 1000 10 10212 25516 10058 19653 19395 32554 6084 10679 17416 6727 9953 5694 32536 31850 1728 8974 5542 15114 6215 2432 1910 4966 11789 29412 13671 3190 30327 18969 15536 29985 20769 19292 5994 4784 4991 18014 9807 4995 196 18073 1985 6658 30978 5603 24590 29655 9...
output:
sxhcnrtkowadcmssnrw4958scufufe45 97152
result:
ok 2 lines
Test #5:
score: 0
Accepted
time: 8ms
memory: 50876kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 2 0 0 42 18468
output:
sxhcnrtkowadcmssnrw4958scufufe45 -1
result:
ok 2 lines
Test #6:
score: 0
Accepted
time: 7ms
memory: 61388kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 5 7 4 155 69 165 91 72 3 4 80 101 70 2 3 72 79 131 1 4 13 54 198 0 3 39 43 44 4 2 10 72 174 2 4 98 157 15 2 1 43 166 103 68 164 65 154 98 162 14 138
output:
sxhcnrtkowadcmssnrw4958scufufe45 114
result:
ok 2 lines
Test #7:
score: 0
Accepted
time: 4ms
memory: 61144kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 2 1 10 1000000000 1000000000 0 1 2 3 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
output:
sxhcnrtkowadcmssnrw4958scufufe45 11000000000
result:
ok 2 lines
Test #8:
score: 0
Accepted
time: 7ms
memory: 61420kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 4 5 3 17 31 18 101 0 3 55 80 168 2 0 3 180 145 1 0 136 189 49 1 3 118 140 141 2 1 6 32 129 80 89 62 96 130 196
output:
sxhcnrtkowadcmssnrw4958scufufe45 269
result:
ok 2 lines
Subtask #2:
score: 5
Accepted
Test #9:
score: 5
Accepted
time: 149ms
memory: 87652kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 0 288190651 14842791 102369069 22526641 78139793 20417021 255921579 66536348 163796053 97265420 122550856 126136 13697971 23427361 8311161 6537077 178044554 326410673 462745163 100002069 185899501 23516602 19951711 6553614 6785326 127328093 93256277 256...
output:
sxhcnrtkowadcmssnrw4958scufufe45 126190414
result:
ok 2 lines
Test #10:
score: 0
Accepted
time: 128ms
memory: 82880kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 10000 100000 0 297749401 170042101 360750979 85788143 131886316 3479631 204925505 22063191 103075473 453625896 59836479 258845875 288784183 90927442 107733495 285965209 150104679 249248572 269973471 316537759 113757781 89311927 138582049 131419861 126463261 64322391 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 157108754
result:
ok 2 lines
Test #11:
score: 0
Accepted
time: 128ms
memory: 86196kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 0 312031649 159894909 354250141 137708072 435349003 45012518 32622721 26669977 249554241 9787002 166668451 180146489 266345223 35907025 440131042 28954310 209707087 79476561 7637925 35377101 103663873 405431217 273454381 474862279 330790267 342877777 14...
output:
sxhcnrtkowadcmssnrw4958scufufe45 848900561
result:
ok 2 lines
Test #12:
score: 0
Accepted
time: 3ms
memory: 50888kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 2 0 0 42 18468
output:
sxhcnrtkowadcmssnrw4958scufufe45 -1
result:
ok 2 lines
Test #13:
score: 0
Accepted
time: 3ms
memory: 53524kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 0 0 42 18468 6335 26501 19170 15725 11479 29359 26963 24465 5706 28146 23282 16828 9962 492 2996 11943 4828 5437 32392 14605 3903 154 293 12383 17422 18717 19719 19896 5448 21727 14772 11539 1870 19913 25668 26300 17036 9895 28704 23812 31323 30334 17674 4665 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 -1
result:
ok 2 lines
Test #14:
score: 0
Accepted
time: 6ms
memory: 57320kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 5 7 0 155 69 165 91 72 3 4 80 101 70 2 3 72 79 131 1 4 13 54 198 0 3 39 43 44 4 2 10 72 174 2 4 98 157 15 2 1 43 166 103
output:
sxhcnrtkowadcmssnrw4958scufufe45 114
result:
ok 2 lines
Test #15:
score: 0
Accepted
time: 191ms
memory: 82620kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 1000 100000 0 139115611 73848481 238307002 169373381 167933151 7739876 325339867 155171122 161710289 262882177 9235579 108440161 379380961 241871126 410257566 98534257 78610221 335455451 499110114 85821201 119927457 149500337 10701001 132782401 318943651 420019862 93...
output:
sxhcnrtkowadcmssnrw4958scufufe45 23512067
result:
ok 2 lines
Test #16:
score: 0
Accepted
time: 10ms
memory: 57072kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 5 7 0 155 69 165 91 72 3 4 80 101 70 2 3 72 79 131 1 4 13 54 198 0 3 39 43 44 4 2 10 72 174 2 4 98 157 15 2 1 43 166 103
output:
sxhcnrtkowadcmssnrw4958scufufe45 114
result:
ok 2 lines
Test #17:
score: 0
Accepted
time: 313ms
memory: 95160kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 0 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100...
output:
sxhcnrtkowadcmssnrw4958scufufe45 2
result:
ok 2 lines
Test #18:
score: 0
Accepted
time: 298ms
memory: 94668kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 99999 0 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 3
result:
ok 2 lines
Subtask #3:
score: 30
Accepted
Dependency #2:
100%
Accepted
Test #19:
score: 30
Accepted
time: 271ms
memory: 101812kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 10000 100000 100000 775788612 564109968 869756020 549148510 331254264 643487188 820647475 27571815 660997758 992797547 786274869 270441223 410235771 701946781 231303194 394619510 201314270 783907970 597277756 951439376 758881126 290581922 617213707 966360073 23925389...
output:
sxhcnrtkowadcmssnrw4958scufufe45 467388008781
result:
ok 2 lines
Test #20:
score: 0
Accepted
time: 253ms
memory: 108192kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 118099115 201672171 567139821 67751354 621656477 517919711 691355574 234866541 460086302 402383358 557456396 731193574 588846643 227781119 284215894 882347205 373697882 26012886 416726297 234678952 95805449 984455140 328116230 264356339 298823123...
output:
sxhcnrtkowadcmssnrw4958scufufe45 1332112678910
result:
ok 2 lines
Test #21:
score: 0
Accepted
time: 8ms
memory: 51076kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 0 0 42 18468 6335 26501 19170 15725 11479 29359 26963 24465 5706 28146 23282 16828 9962 492 2996 11943 4828 5437 32392 14605 3903 154 293 12383 17422 18717 19719 19896 5448 21727 14772 11539 1870 19913 25668 26300 17036 9895 28704 23812 31323 30334 17674 4665 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 -1
result:
ok 2 lines
Test #22:
score: 0
Accepted
time: 3ms
memory: 50916kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 2 0 0 42 18468
output:
sxhcnrtkowadcmssnrw4958scufufe45 -1
result:
ok 2 lines
Test #23:
score: 0
Accepted
time: 798ms
memory: 130784kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 10 100000 100000 543712049 39447313 299769228 736163695 803902651 428205497 526947507 617324530 136953197 345880834 0 8 632159 6632589 65930164 8 7 8578500 10489437 212959492 7 8 13629390 15847168 847640503 8 5 16077113 16377651 367740556 5 1 16468539 16554622 516758...
output:
sxhcnrtkowadcmssnrw4958scufufe45 288512621118
result:
ok 2 lines
Test #24:
score: 0
Accepted
time: 302ms
memory: 107836kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 345196838 828126967 732095245 375711572 947367168 629971613 819394058 982108058 481802771 101606297 110521548 592675434 798203864 109565757 934649552 694924655 653154476 75702834 738900141 412342170 559325458 714697252 927531724 345570275 1753274...
output:
sxhcnrtkowadcmssnrw4958scufufe45 1095898656790
result:
ok 2 lines
Test #25:
score: 0
Accepted
time: 914ms
memory: 139128kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100 100000 100000 847067182 993258164 244456172 723143488 667620501 327126937 599525387 852930610 801631198 484730663 569478102 50583524 380852950 933749466 419326315 835552577 492153165 655439653 915553441 32768192 480682276 157811315 751049488 463566644 266505441 7...
output:
sxhcnrtkowadcmssnrw4958scufufe45 1940705494441
result:
ok 2 lines
Test #26:
score: 0
Accepted
time: 531ms
memory: 122456kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 100000101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 6666713433500
result:
ok 2 lines
Test #27:
score: 0
Accepted
time: 405ms
memory: 124076kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 100000101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 6666710100200
result:
ok 2 lines
Subtask #4:
score: 60
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Test #28:
score: 60
Accepted
time: 305ms
memory: 106100kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 17107989 602311971 661033269 852608746 558238036 509217498 613482191 248765344 317401296 119456939 753645948 824343297 324667124 687497173 125219081 661615694 872795190 759184776 461028814 611260855 544969176 558903348 320877219 741898373 4285337...
output:
sxhcnrtkowadcmssnrw4958scufufe45 641438247770
result:
ok 2 lines
Test #29:
score: 0
Accepted
time: 307ms
memory: 105216kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 477475099 924305652 518135340 348709773 817578190 260664944 722265715 562805499 145576485 467707832 640293393 885194841 408892506 59193624 518633067 124779545 942618539 905088633 367078223 560909820 273889864 52660680 993538099 152105669 50212154...
output:
sxhcnrtkowadcmssnrw4958scufufe45 696070649328
result:
ok 2 lines
Test #30:
score: 0
Accepted
time: 343ms
memory: 107952kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 681985425 441162529 555317660 381854024 19184775 887880332 272671076 668046472 46230866 430830094 514843905 706539576 851161280 409937757 410042276 213309268 640749283 854248749 435398127 894394391 742798061 514332094 96760422 718909362 658993322...
output:
sxhcnrtkowadcmssnrw4958scufufe45 866138214473
result:
ok 2 lines
Test #31:
score: 0
Accepted
time: 360ms
memory: 106404kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 155856608 954266509 157787749 79525062 1054475 901838377 466351353 766362491 345933363 303908572 812550449 688391653 327301010 938692137 270095689 953059612 897861046 312178253 578907699 34097309 594195266 744909469 49308913 440531982 667276376 7...
output:
sxhcnrtkowadcmssnrw4958scufufe45 238146594628
result:
ok 2 lines
Test #32:
score: 0
Accepted
time: 302ms
memory: 103208kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 10000 100000 100000 575804277 992653660 344699330 125568057 14750857 743954727 384786599 214309191 972992686 493626452 808014988 167759197 247387987 673241769 482903407 576620585 708734844 490411670 900218051 24160880 890632022 637165753 539231847 975104066 448507456...
output:
sxhcnrtkowadcmssnrw4958scufufe45 353540142622
result:
ok 2 lines
Test #33:
score: 0
Accepted
time: 366ms
memory: 103668kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 1000 100000 100000 432263208 919889404 857833126 914422290 449868080 805445710 857750695 2578719 526698148 678573758 941290653 658531549 459980056 942522947 588587723 488674738 258635554 457674253 105842710 369174791 539503259 957651093 722280786 395048222 420304525 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 271558112625
result:
ok 2 lines
Test #34:
score: 0
Accepted
time: 335ms
memory: 103856kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 1000 100000 100000 732207193 997527135 8363697 721549685 214875676 353632298 191483453 259738236 235054831 924260625 523799515 783152153 113102681 118503044 738145208 260254075 22691009 18579794 902071092 426821574 109632144 116732441 229784188 179098653 362198252 60...
output:
sxhcnrtkowadcmssnrw4958scufufe45 145708991063
result:
ok 2 lines
Test #35:
score: 0
Accepted
time: 330ms
memory: 103788kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 1000 100000 100000 999078336 839687122 308842705 647029235 176980564 437779990 57916695 983279782 411938203 483770491 701698263 402829422 794267401 438994376 873472297 953705050 973609427 379751098 87775256 615156475 748555258 365556710 725838402 652137997 817351300 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 84308865835
result:
ok 2 lines
Test #36:
score: 0
Accepted
time: 777ms
memory: 131632kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 10 100000 100000 792937481 496174680 749906273 591612277 324926226 456727507 153400086 661468907 488892180 739679523 0 7 311221 618588 313545790 7 3 759586 1086574 19876925 3 6 1643909 1899626 92172092 6 1 1996378 2552089 873389811 1 6 2709659 2718799 788156337 6 3 2...
output:
sxhcnrtkowadcmssnrw4958scufufe45 1456150290610
result:
ok 2 lines
Test #37:
score: 0
Accepted
time: 772ms
memory: 128616kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 10 100000 100000 836475481 409043972 905216691 693654414 49815866 452976369 485141858 298700912 363865469 201451497 0 5 29038 48121 498791556 5 6 66920 80117 336390884 6 1 123038 146331 473292489 1 3 159540 165435 270748970 3 4 167834 170458 147249081 4 8 178494 1848...
output:
sxhcnrtkowadcmssnrw4958scufufe45 2527938480147
result:
ok 2 lines
Test #38:
score: 0
Accepted
time: 781ms
memory: 129904kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 10 100000 100000 719956520 391967711 299597463 393009201 526968819 481659633 289379703 354275132 373921801 292912874 0 2 3393 9352 836472924 2 3 20588 22703 521491889 3 8 30355 57270 190286143 8 5 66073 68079 368170956 5 3 73888 95724 951859072 3 2 110337 125445 7607...
output:
sxhcnrtkowadcmssnrw4958scufufe45 12961443292138
result:
ok 2 lines
Test #39:
score: 0
Accepted
time: 309ms
memory: 102548kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 1000 100000 100000 801218795 946193574 360641768 884692260 423831879 445643866 402500368 945538310 325559446 489255480 143780132 91236921 119560806 251514266 484727256 58376740 246580987 185182778 225452406 734986275 63151333 362455449 712407651 785180768 535412298 1...
output:
sxhcnrtkowadcmssnrw4958scufufe45 88443907337
result:
ok 2 lines
Test #40:
score: 0
Accepted
time: 269ms
memory: 107712kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 797428650 317218681 553662745 896028277 117551500 284603532 493887695 867669071 972849018 288039861 380221752 132229013 598058044 999755827 961749605 756860452 613589293 549512567 526220481 60505470 70391581 43073914 393578835 342502029 314544184...
output:
sxhcnrtkowadcmssnrw4958scufufe45 763714506979
result:
ok 2 lines
Test #41:
score: 0
Accepted
time: 546ms
memory: 103384kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 250 100000 100000 498189985 849088844 752589137 129271757 820126303 968116665 196184828 360363736 510348673 13909635 630330747 603002104 357420012 600240369 222072667 470442034 477625278 993395584 778723603 903432879 876888175 654374935 339888230 513532805 219279767 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 853331383669
result:
ok 2 lines
Test #42:
score: 0
Accepted
time: 684ms
memory: 128908kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 4 100000 100000 37485861 790481497 290888225 426362296 0 1 4164 4450 989649002 1 2 37800 66905 79722533 2 1 73626 91554 649937109 1 2 103997 134747 584933047 2 1 161819 178007 649149062 1 2 243692 373440 616826756 2 1 502018 534577 550531535 1 2 548732 565025 8202478...
output:
sxhcnrtkowadcmssnrw4958scufufe45 2081763579030
result:
ok 2 lines
Test #43:
score: 0
Accepted
time: 302ms
memory: 104784kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 314506830 841072434 224993729 597207489 725738339 770673703 379680051 23162557 426528437 424985592 415007288 491019576 931234098 678110837 135570369 227408778 14581855 394239442 108494784 9968283 853021536 604703519 973756116 199756129 932325500 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 399461094547
result:
ok 2 lines
Test #44:
score: 0
Accepted
time: 168ms
memory: 79508kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 10461 23195 24247 13457 16870 3305 13254 17582 27113 30994 31481 9041 11155 11419 17164 15949 12093 6407 14278 20835 17521 1869 6036 5466 9385 24457 11377 25937 21337 6386 19464 20053 16176 26124 8989 15663 2203 28959 20521 15999 4492 15591 4420 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 -1
result:
ok 2 lines
Test #45:
score: 0
Accepted
time: 160ms
memory: 80064kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 10000 100000 100000 10480 22149 360 26765 13222 26866 31929 18 27879 26874 30593 9305 12916 12393 19245 21673 9161 18654 25262 30911 20478 29219 30589 14785 31467 25274 8156 26488 15759 30392 4702 15801 1459 16599 17065 7716 14538 12742 15227 4626 32284 18883 23019 1...
output:
sxhcnrtkowadcmssnrw4958scufufe45 -1
result:
ok 2 lines
Test #46:
score: 0
Accepted
time: 200ms
memory: 75996kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 1000 100000 100000 10497 10355 24145 16009 32027 13731 14723 18150 12133 28901 29854 9526 25307 29588 31902 10060 12179 12477 1648 17462 12019 8319 7359 17090 6178 15032 16395 10562 188 1246 19707 23181 5578 14122 7412 1094 24817 15612 5354 16993 28137 5243 5750 7138...
output:
sxhcnrtkowadcmssnrw4958scufufe45 5194655
result:
ok 2 lines
Test #47:
score: 0
Accepted
time: 330ms
memory: 108208kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 498189985 849088844 752589137 129271757 820126303 968116665 196184828 360363736 510348673 13909635 630330747 603002104 357420012 600240369 222072667 470442034 477625278 993395584 778723603 903432879 876888175 654374935 339888230 513532805 2192797...
output:
sxhcnrtkowadcmssnrw4958scufufe45 773788169830
result:
ok 2 lines
Test #48:
score: 0
Accepted
time: 336ms
memory: 104968kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 580007205 150061084 958947847 7714087 916265683 904911403 879679614 760634374 145954145 401862009 496747768 336933668 796394106 167566535 420255970 235822830 351413703 978463550 733527768 617067104 958631019 263921816 936305756 11940502 269036077...
output:
sxhcnrtkowadcmssnrw4958scufufe45 813130514477
result:
ok 2 lines
Test #49:
score: 0
Accepted
time: 288ms
memory: 107816kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 441868089 808372288 300831874 541069430 851861500 895513997 48206065 45634393 610624991 864221118 410351646 721758347 883684562 505041424 775802683 605079305 654415657 338040306 635844556 470082595 802448283 708515699 581609280 640404434 94596114...
output:
sxhcnrtkowadcmssnrw4958scufufe45 732985426178
result:
ok 2 lines
Test #50:
score: 0
Accepted
time: 728ms
memory: 108448kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 100000101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 110000202
result:
ok 2 lines
Test #51:
score: 0
Accepted
time: 512ms
memory: 114724kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 100000101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 10000101
result:
ok 2 lines
Test #52:
score: 0
Accepted
time: 475ms
memory: 112264kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 100000101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 3333400
result:
ok 2 lines
Test #53:
score: 0
Accepted
time: 486ms
memory: 112712kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 100000101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 10000101
result:
ok 2 lines
Test #54:
score: 0
Accepted
time: 461ms
memory: 111960kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 100000101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 10000101
result:
ok 2 lines
Test #55:
score: 0
Accepted
time: 469ms
memory: 113968kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 100000101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 8333401
result:
ok 2 lines
Test #56:
score: 0
Accepted
time: 503ms
memory: 115708kb
input:
43hecs9qw9w9dw8h39fnasqwu84r8dev 100000 100000 100000 999998101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 ...
output:
sxhcnrtkowadcmssnrw4958scufufe45 7145401
result:
ok 2 lines