QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#276703 | #5497. 品酒大会 | SoyTony | 100 ✓ | 121ms | 26204kb | C++14 | 2.5kb | 2023-12-06 09:44:51 | 2023-12-06 09:44:51 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=3e5+10;
const ll inf=1e18;
inline int read(){
int x=0,w=1;char c=getchar();
while(c<'0'||c>'9'){if(c=='-')w=-1;c=getchar();}
while(c<='9'&&c>='0'){x=(x<<3)+(x<<1)+c-'0';c=getchar();}
return x*w;
}
int n;
char s[maxn];
int a[maxn];
int sa[maxn],rk[maxn<<1],cnt[maxn],oldsa[maxn],oldrk[maxn<<1],tmp[maxn];
int height[maxn];
inline bool cmp(int x,int y,int l){
return oldrk[x]==oldrk[y]&&oldrk[x+l]==oldrk[y+l];
}
int bel[maxn],siz[maxn],mx[maxn],mn[maxn];
int find(int x){
if(x==bel[x]) return x;
return bel[x]=find(bel[x]);
}
struct edge{
int u,v,w;
edge()=default;
edge(int u_,int v_,int w_):u(u_),v(v_),w(w_){}
bool operator<(const edge&rhs)const{
return w>rhs.w;
}
}e[maxn];
inline void get_sa(){
int siz=max(n,127);
for(int i=1;i<=n;++i) ++cnt[rk[i]=s[i]];
for(int i=1;i<=siz;++i) cnt[i]+=cnt[i-1];
for(int i=n;i>=1;--i) sa[cnt[rk[i]]--]=i;
for(int l=1,k;;l<<=1){
k=0;
for(int i=n;i+l>n;--i) oldsa[++k]=i;
for(int i=1;i<=n;++i) if(sa[i]>l) oldsa[++k]=sa[i]-l;
memset(cnt,0,sizeof(cnt));
for(int i=1;i<=n;++i) ++cnt[tmp[i]=rk[oldsa[i]]];
for(int i=1;i<=siz;++i) cnt[i]+=cnt[i-1];
for(int i=n;i>=1;--i) sa[cnt[tmp[i]]--]=oldsa[i];
for(int i=1;i<=n;++i) oldrk[i]=rk[i];
k=0;
for(int i=1;i<=n;++i) rk[sa[i]]=cmp(sa[i],sa[i-1],l)?k:++k;
if(k==n) break;
siz=k;
}
for(int i=1,k=0;i<=n;++i){
if(k) --k;
while(s[i+k]==s[sa[rk[i]-1]+k]) ++k;
height[rk[i]]=k;
}
for(int i=1;i<n;++i) e[i]=edge(sa[i],sa[i+1],height[i+1]);
sort(e+1,e+n);
}
ll anssiz[maxn],ansmx[maxn];
int main(){
n=read();
scanf("%s",s+1);
for(int i=1;i<=n;++i){
a[i]=read();
bel[i]=i,siz[i]=1,mx[i]=mn[i]=a[i];
}
get_sa();
memset(ansmx,~0x3f,sizeof(ansmx));
for(int i=1;i<n;++i){
int fu=find(e[i].u),fv=find(e[i].v);
anssiz[e[i].w]+=1ll*siz[fu]*siz[fv];
ansmx[e[i].w]=max({ansmx[e[i].w],1ll*mx[fu]*mx[fv],1ll*mn[fu]*mn[fv]});
bel[fv]=fu;
bel[fv]=fu,siz[fu]+=siz[fv],mx[fu]=max(mx[fu],mx[fv]),mn[fu]=min(mn[fu],mn[fv]);
}
for(int i=n-1;i>=0;--i) anssiz[i]+=anssiz[i+1],ansmx[i]=max(ansmx[i],ansmx[i+1]);
for(int i=0;i<n;++i){
printf("%lld ",anssiz[i]);
if(anssiz[i]) printf("%lld\n",ansmx[i]);
else printf("0\n");
}
return 0;
}
详细
Test #1:
score: 5
Accepted
time: 0ms
memory: 7388kb
input:
100 ycobizcoyizcobiyyobiycobiycoyiycybyyyobiycobizyoyiycybyzcoyiycoyizcoyizcybiyyoyiycobyzcoyizcybizcobi -678 -8729 7229 6391 -7120 372 -7522 9713 -7138 4498 -5299 3500 9655 -490 8846 3401 738 -4171 -5842 -9460 1407 4061 -7514 6593 -448 6527 -7726 4790 -2842 6006 4622 283 -7270 -6469 -5689 788 -6190...
output:
4950 93779015 913 93779015 327 93701311 188 93701311 103 93701311 59 93701311 32 74513428 15 74513428 8 74513428 4 66110562 2 66110562 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 100 lines
Test #2:
score: 5
Accepted
time: 2ms
memory: 7176kb
input:
200 pkhktkydzivcuypurfmbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbzazcbisgekyrgzvxdhpoamvaf 746 3544 1800 -2348 821 3629 5984 -1913 -517 -9336 -3063 -2344 -8129 956 6736 -6370 6368 -7957 ...
output:
19900 97697938 3785 97697938 2481 97697938 2449 97697938 2418 97697938 2387 90221956 2356 90221956 2325 90221956 2295 90221956 2265 90221956 2235 90221956 2205 90221956 2175 90221956 2146 90221956 2117 90221956 2088 90221956 2059 90221956 2030 90221956 2002 90221956 1974 90221956 1946 90221956 1918 ...
result:
ok 200 lines
Test #3:
score: 5
Accepted
time: 0ms
memory: 7488kb
input:
500 yylooqylooqylooqylooyylooqylooqyyooqylooqylooqyloyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...
output:
124750 99580441 107651 99580441 102543 99580441 100719 99580441 100248 99580441 99781 99580441 99318 99580441 98856 99580441 98398 99580441 97942 99580441 97489 99580441 97040 99580441 96592 99580441 96148 99580441 95707 99580441 95268 99580441 94831 99580441 94395 99580441 93961 99580441 93528 9958...
result:
ok 500 lines
Test #4:
score: 5
Accepted
time: 2ms
memory: 7340kb
input:
750 sepjeiszsgcezwapqrvlwigrovjcdzxxphqlsrzihmgzrioqrqetkzfbldjiemsfzbhzfnwywmyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...
output:
280875 99460720 228933 99460720 227477 99460720 226801 99460720 226128 99460720 225456 99460720 224785 99460720 224115 99460720 223446 99460720 222778 99460720 222111 99460720 221445 99460720 220780 99460720 220116 99460720 219453 99460720 218791 99460720 218130 99460720 217470 99460720 216811 99460...
result:
ok 750 lines
Test #5:
score: 5
Accepted
time: 3ms
memory: 7204kb
input:
1000 yyxpquyxpquyxpquyxpquyxpquyxpquyxpquyxpquyxpquyxpquyxyquyxpquyypquyxpquyxpquyxpquyxpquyxyquyxpquyxpyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...
output:
499500 997873281764292676 428016 997873281764292676 407138 997873281764292676 404370 997873281764292676 403406 997873281764292676 402446 997873281764292676 401492 997873281764292676 400543 997873281764292676 399597 997873281764292676 398654 997873281764292676 397726 997873281764292676 396801 9978732...
result:
ok 1000 lines
Test #6:
score: 5
Accepted
time: 0ms
memory: 7460kb
input:
1000 ufvqqevcpcjpmjhpuacsiasptskqyhitauzfablpqlkukahmlivzaprotlqdiuoeeykiqzahfavzzrfrzzemiyzvobxuojorawuyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...
output:
499500 994651547059417160 408358 994651547059417160 404556 994651547059417160 403651 994651547059417160 402753 994651547059417160 401856 994651547059417160 400960 994651547059417160 400065 994651547059417160 399171 994651547059417160 398278 994651547059417160 397386 994651547059417160 396495 9946515...
result:
ok 1000 lines
Test #7:
score: 5
Accepted
time: 3ms
memory: 7564kb
input:
2000 yisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjkyisjyyisjkyisjkyisjkyisjyyisjkyisjkyisjyyisjkyisjkyisjkyisjkyisjkyisjkyiyjkyisjkyisjyyisjkyisjkyisjkyisykyisjkyisjkyisjkyisjkyisjkyisjkyisjyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...
output:
1999000 997220632557111954 1707638 997220632557111954 1629696 997220632557111954 1620455 997220632557111954 1618416 997220632557111954 1616384 997220632557111954 1614380 997220632557111954 1612383 997220632557111954 1610392 997220632557111954 1608407 997220632557111954 1606429 997220632557111954 160...
result:
ok 2000 lines
Test #8:
score: 5
Accepted
time: 3ms
memory: 7436kb
input:
2000 kfjzifydlimlbcikxuqhsdhzkuurcqqukqeudywkqejhrbtmdhnoyqsxevpmzwainltqupqtomolcbwlhobszmwhmclekitsiragstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjkstvjyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy...
output:
1999000 999779472717753420 1627752 999779472717753420 1620016 999779472717753420 1618195 999779472717753420 1616377 999779472717753420 1614561 999779472717753420 1612747 999779472717753420 1610934 999779472717753420 1609122 999779472717753420 1607311 999779472717753420 1605501 999779472717753420 160...
result:
ok 2000 lines
Test #9:
score: 5
Accepted
time: 15ms
memory: 13760kb
input:
99991 jkfuewizynextldskyvvtntwtciajvawlycikgpsboddojcqmcdcrkwwojxzxviaigefgjadwfjxzbuosftlaqjdjcautphjxxyfcqumvqetxuqidrkeqpvpekbybddypwfazagrvwbdyfkkndeytkptcsrpnbygwpzeipbseyvyqcfulhranbscrzjzxghpdmtnbtqtuukznppnrpblccgmbjgxlnzfufxlesdwnghnbrfxlegugilossxyxycfornwgtjhxuojsajkkmzlthtbaefhlfekbtigui...
output:
4999050045 1000000000000000000 192257116 1000000000000000000 7396985 999023997374801902 285304 996613325555096340 11066 987366165970503448 436 942986931170000909 9 192230346497810339 1 -309626952698982272 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
result:
ok 99991 lines
Test #10:
score: 5
Accepted
time: 20ms
memory: 13804kb
input:
99991 hufyxaiiojcxmvuiafrvwahkgmhwluvmhadvfoadukpjksusarwkxrahobwzevkwtfuofyhugqjgnlbonxsbimgcbmuruexltzbylckparzzlkswdlpkcvyibqizxxwpxavrvvaxynttazmaguqynhjumlthdinypdtaopojkrqgmkxtmergcefqgpepkamycinacstheaatpokkcnnwowdsymykrfhgxvunpdmcppdpoykcqwdbpmppirgjhxlridaivuosrbakjqadhtdrnkccpmqhgnygwulaet...
output:
4999050045 1000000000000000000 192263210 1000000000000000000 7397014 999329359000000000 284213 996665835000000000 10926 981569601668597568 410 943003222342727040 11 687932476088996908 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 99991 lines
Test #11:
score: 5
Accepted
time: 26ms
memory: 13508kb
input:
100000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
4999950000 1 4999250039 1 4998450142 1 4997650309 1 4996850540 1 4996050835 1 4995251194 1 4994451617 1 4993652104 1 4992852655 1 4992053270 1 4991253949 1 4990454692 1 4989655499 1 4988856370 1 4988057305 1 4987258304 1 4986459367 1 4985660494 1 4984861685 1 4984062940 1 4983264259 1 4982465642 1 4...
result:
ok 100000 lines
Test #12:
score: 5
Accepted
time: 57ms
memory: 20256kb
input:
200000 jmzhvqnlcbtiqjxdafwqxudmphrvvoekulwyscwgcorhxryphomcmzyyqfowbhebqmcyliwqfhpnuptzotaxldmxwalangsjpoygvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjhqbxxwxcvjh...
output:
19999900000 1 3195202338 1 1995922106 1 1995862142 1 1995842163 1 1995822184 1 1995802205 1 1995782226 1 1995762247 1 1995742268 1 1995722289 1 1995702310 1 1995682332 1 1995662354 1 1995642376 1 1995622398 1 1995602420 1 1995582442 1 1995562464 1 1995542486 1 1995522508 1 1995502530 1 1995482553 1 ...
result:
ok 200000 lines
Test #13:
score: 5
Accepted
time: 89ms
memory: 26204kb
input:
300000 bababbabaabbbbbbbaabbbaaabbaaabaaabbbabbbbbabbabbbabaaabbbbaabbbbaaabababbbabaabbabbbbabbbabaaababbbaaaaaababbabbabbbaaababbbabaaaaaaaaaabbaabaabaabbabbabbbbabaababbbbababbbabbabbbbaaaabbaabbbababababaabbabaaaabbbbbbbbbabbbbaaaaaaaaaababbbbbababbbabbbbabbabbbbbbbbbbbaabbbaabaabbbbabbabaababbb...
output:
44999850000 1 22499860609 1 11249786351 1 5624785965 1 2812329801 1 1406104358 1 703122339 1 351603532 1 175851213 1 87954688 1 43995139 1 22008053 1 11047594 1 5587723 1 2859492 1 1526325 1 860192 1 529280 1 365522 1 283451 1 243481 1 224276 1 215045 1 210491 1 208416 1 207521 1 207106 1 206907 1 2...
result:
ok 300000 lines
Test #14:
score: 5
Accepted
time: 81ms
memory: 26192kb
input:
300000 yvsktzpfklkhfnuhptasnazpugsnfwyohpshtichibrluvqndfyqbwhtsswyxjsoyhweaqmqedyreoxpvnyzcnnvhxywoooebdqvgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdxcbcnavlgdx...
output:
44999850000 1 5394601964 1 4493972061 1 4493822124 1 4493762163 1 4493732184 1 4493702205 1 4493672226 1 4493642247 1 4493612268 1 4493582289 1 4493552310 1 4493522332 1 4493492354 1 4493462376 1 4493432398 1 4493402420 1 4493372442 1 4493342464 1 4493312486 1 4493282508 1 4493252530 1 4493222553 1 ...
result:
ok 300000 lines
Test #15:
score: 5
Accepted
time: 25ms
memory: 13572kb
input:
100000 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
output:
4999950000 1000000000000000000 4999050063 1000000000000000000 4998050226 1000000000000000000 4997050489 1000000000000000000 4996050852 1000000000000000000 4995051315 1000000000000000000 4994051878 1000000000000000000 4993052541 1000000000000000000 4992053304 1000000000000000000 4991054167 1000000000...
result:
ok 100000 lines
Test #16:
score: 5
Accepted
time: 29ms
memory: 13632kb
input:
100000 gomybwamxftmutuwgzvissuiewapzcztvtvbowslcegtzrjxqlziviuavnzykfunvzwvzhwdgyiaslratbdrcmtqsfklbbnuxkhdteuaybxjhrkacvdqxuqyrclynhmnskedcnvslkboanoopqaqnolbimapontqmgbhcostjbgslklcgdekvadptkicijfovnaihnrtmqeiblebpkfxjgqrqovxrvygrycpfryvefrnoysggkliqtyiskltzsjklybkgzgrqqgheztmnjxuktclfonyvoujklvai...
output:
4999950000 1000000000000000000 193056954 1000000000000000000 8164719 999771514013239348 1094549 999574837586297120 813076 999574837586297120 801924 999574837586297120 801618 999574837586297120 801601 999574837586297120 801584 999574837586297120 801567 999574837586297120 801550 999574837586297120 801...
result:
ok 100000 lines
Test #17:
score: 5
Accepted
time: 69ms
memory: 19856kb
input:
200000 aabababbbaaaabbbbbbbabaaabaaaaaaabaaababaaababbabbabbbbbaabaaaabbbaaabbabbbbbbbbbbaabbbbabaaabaababababbaaabaababaabbabaabbabaaaababbbabababbbbbbbaabababbbabbabababbbbabaaaabaaabbbbaaaaabaabaabbaaabbbbbababbbaaabbababbbabbbabaabaaaabbaabbaabbbbbbaaabbbaaababaababbbbbababbababbaaabaabbbbabbbab...
output:
19999900000 1000000000000000000 9999903600 1000000000000000000 4999853841 1000000000000000000 2499853021 1000000000000000000 1249874362 1000000000000000000 624892814 1000000000000000000 312470665 1000000000000000000 156245952 999968173000000000 78133895 999968173000000000 39066322 999848394160616010...
result:
ok 200000 lines
Test #18:
score: 5
Accepted
time: 60ms
memory: 20108kb
input:
200000 foyorwsdobxplxrtvjopjvqcettbxeemcyihlspvhsfoaelerivojwwqzcvbkvpmsyuknfexllnauhvobpwyhndqbmllpzapjxychsvnmunmagwnbhhoprkyrmnmowygsioyvmfipvqoklcdxwcthtiasdotwcmnzbdkqnolsfllqmovgdcbozlqoqaumlmbfvedakusywgltbjtuytjmyzfkddyewrdsilecumcqqxzcctjbzfvqogiwooytexasinwohexptgdtxyinabqrafefrdxhfktrocak...
output:
19999900000 1000000000000000000 774135747 1000000000000000000 35121304 999730000756931088 6858948 999266856000000000 5813898 999073581000000000 5758909 999073581000000000 5748467 999073581000000000 5748409 999073581000000000 5748351 999073581000000000 5748293 999073581000000000 5748235 9990735810000...
result:
ok 200000 lines
Test #19:
score: 5
Accepted
time: 83ms
memory: 26204kb
input:
300000 vxaychagqqvywvquirkkpahbblihyplhxijpaucmiffhtrhptosxlvjmkcjtknwqwluioijkvrpfbarplbjyupydfvjbpdegxghovhxbjxpgxmctpznarnmumjblxozxohtghpnqavcbckyoesrufgsbiccwlupmtncifwztsgiquqrtyjfdsuhiarpigoddbaalqineqizbouwhhmdftlyoqqdyuaerbsrimnskbluidqehlvqozeqoxrsolgraspwsyhbiubjkvmbeyoangdslogspcihppxqmf...
output:
44999850000 1000000000000000000 1735116652 1000000000000000000 73609946 999986089000000000 9295081 999100914583394747 7047345 999100914583394747 6975348 999100914583394747 6973437 999100914583394747 6971573 999100914583394747 6969709 999100914583394747 6967845 999100914583394747 6965981 999100914583...
result:
ok 300000 lines
Test #20:
score: 5
Accepted
time: 121ms
memory: 26156kb
input:
300000 pfnbnjwngghmwghvpnfkhgiyikbgiyygimohxgonmmzmhqwonftsowohpyjcreqohrbjayzyygqcdspyojdxiybavspyktrnadsimixfhqolagutuarwpdtogecsqbyuujrcqehelachyxzfkyhbjzasjndwegyyaskgbwjjrnpyqvvpihnepobovtoqufustenolvlqmlrxeadgmaflvcgrrpmvnnmjbsneebhcpcrqxrfohlugnstbyopjfpnpvifcpktmpbrlitcjepavsrwwdbhdxhvevtfpo...
output:
44999850000 1000000000000000000 1734971766 1000000000000000000 71721169 999819731878054944 7375509 999789963135323740 4836733 999789963135323740 4746400 999789963135323740 4742176 999789963135323740 4742144 999789963135323740 4742112 999789963135323740 4742080 999789963135323740 4742048 999789963135...
result:
ok 300000 lines
Extra Test:
score: 0
Extra Test Passed