QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#367082 | #3100. Meetings 2 | Rikku_eq | 20 | 7ms | 15128kb | C++14 | 2.4kb | 2024-03-25 17:38:21 | 2024-03-25 17:38:21 |
Judging History
answer
#include <bits/stdc++.h>
#define N 200005
#define mxL 20
using namespace std;
typedef long long ll;
int n, L, lg2[N*2], rec[N], stk[N];
int sz[N], d[N], tI[N], id[N*2], tmr;
int st[N][mxL], stD[N][mxL], p[N][mxL];
vector <int> vec[N], to[N];
void dfs (int u, int fa)
{
sz[u]=1; d[u]=d[fa]+1;
tI[u]=++tmr; id[tmr]=d[u];
p[u][0]=fa;
for (int i=1; i<=L; i++) { p[u][i]=p[p[u][i-1]][i-1]; }
int mx=0;
for (int i=0; i<(int)to[u].size(); i++) {
int v=to[u][i];
if (v==fa) { continue; }
dfs(v, u); sz[u]+=sz[v];
id[++tmr]=d[u];
mx=max(mx, sz[v]);
}
for (int i=mx+1; i<=sz[u]; i++) { vec[i].push_back(u); }
}
inline int mn (int l, int r) { return min(st[l][lg2[r-l+1]], st[r-(1<<lg2[r-l+1])+1][lg2[r-l+1]]); }
inline int mxD (int l, int r) { return max(stD[l][lg2[r-l+1]], stD[r-(1<<lg2[r-l+1])+1][lg2[r-l+1]]); }
int main ()
{
// freopen("0test.in", "r", stdin);
// freopen("0test.out", "w", stdout);
scanf("%d", &n);
L=ceil(log(n*2)/log(2));
for (int i=1; i<n; i++) {
int u, v; scanf("%d %d", &u, &v);
to[u].push_back(v);
to[v].push_back(u);
}
for (int i=2; i<=n*2; i++) { lg2[i]=lg2[i>>1]+1; }
dfs(1, 0);
for (int j=tmr; j>=1; j--) {
st[j][0]=id[j];
for (int k=1; j+(1<<(k-1))<=tmr; k++) {
st[j][k]=min(st[j][k-1], st[j+(1<<(k-1))][k-1]);
}
}
for (int i=1; i<=n; i++) {
if (i&1) { printf("1\n"); continue; }
int t=i/2;
int res=-n-1, ans=0;
int tp=0, len=vec[t].size();
for (int j=len-1; j>=0; j--) {
stD[j][0]=d[vec[t][j]];
for (int k=1; j+(1<<(k-1))<len; k++) {
stD[j][k]=max(stD[j][k-1], stD[j+(1<<(k-1))][k-1]);
}
int u=vec[t][j];
int dep=d[u];
for (int k=L; k>=0; k--) {
if (p[u][k] && sz[p[u][k]]<=n-(i/2)) { u=p[u][k]; }
}
ans=max(ans, dep-d[u]+(sz[u]<=n-(i/2)));
}
for (int j=1; j<len; j++) {
int u=vec[t][j];
rec[j]=mn(tI[vec[t][j-1]], tI[u]);
while (tp>0 && rec[stk[tp]]>rec[j]) { tp--; }
// (stk[tp], j-1)
res=max(res, mxD(stk[tp], j-1)-rec[j]*2);
ans=max(ans, res+d[u]);
stk[++tp]=j;
}
ans++; printf("%d\n", ans);
}
return 0;
}
詳細信息
Subtask #1:
score: 4
Accepted
Test #1:
score: 4
Accepted
time: 0ms
memory: 13416kb
input:
1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 13384kb
input:
2 2 1
output:
1 2
result:
ok 2 lines
Test #3:
score: 0
Accepted
time: 0ms
memory: 13352kb
input:
3 1 3 3 2
output:
1 3 1
result:
ok 3 lines
Test #4:
score: 0
Accepted
time: 0ms
memory: 13528kb
input:
14 12 14 12 9 14 2 12 6 12 7 6 4 3 4 1 4 12 8 13 1 10 12 11 6 6 5
output:
1 7 1 5 1 3 1 3 1 2 1 2 1 2
result:
ok 14 lines
Test #5:
score: 0
Accepted
time: 5ms
memory: 13464kb
input:
14 10 14 3 10 14 13 1 3 3 5 3 11 12 14 14 6 11 8 2 3 7 8 9 7 1 4
output:
1 8 1 6 1 5 1 4 1 2 1 1 1 1
result:
ok 14 lines
Test #6:
score: 0
Accepted
time: 0ms
memory: 13532kb
input:
14 8 13 13 10 13 7 6 8 5 7 10 4 9 5 12 8 6 2 4 11 5 1 9 3 4 14
output:
1 8 1 6 1 5 1 4 1 2 1 1 1 1
result:
ok 14 lines
Test #7:
score: 0
Accepted
time: 2ms
memory: 13368kb
input:
14 9 2 9 8 3 8 14 9 13 3 1 2 5 2 9 6 4 2 4 11 10 6 12 10 7 9
output:
1 7 1 5 1 3 1 2 1 2 1 1 1 1
result:
ok 14 lines
Test #8:
score: 0
Accepted
time: 0ms
memory: 13496kb
input:
15 10 7 15 7 14 7 15 11 6 15 10 8 14 2 4 8 15 1 3 6 4 13 1 9 5 2 8 12
output:
1 8 1 6 1 4 1 4 1 3 1 2 1 1 1
result:
ok 15 lines
Test #9:
score: 0
Accepted
time: 0ms
memory: 13468kb
input:
16 11 8 11 10 10 1 11 2 15 8 13 10 9 2 2 4 8 6 2 7 3 7 12 9 6 16 9 14 12 5
output:
1 8 1 6 1 4 1 4 1 2 1 2 1 2 1 2
result:
ok 16 lines
Test #10:
score: 0
Accepted
time: 5ms
memory: 13396kb
input:
16 7 11 16 11 11 6 1 16 1 14 1 3 12 3 14 8 12 10 5 16 6 9 6 4 9 2 15 4 2 13
output:
1 10 1 8 1 6 1 4 1 4 1 4 1 2 1 2
result:
ok 16 lines
Test #11:
score: 0
Accepted
time: 0ms
memory: 13364kb
input:
16 13 3 16 13 16 5 16 8 3 12 11 16 14 8 15 12 3 10 10 2 16 1 6 10 11 9 8 4 1 7
output:
1 7 1 5 1 5 1 3 1 3 1 3 1 2 1 1
result:
ok 16 lines
Test #12:
score: 0
Accepted
time: 0ms
memory: 13308kb
input:
16 12 13 13 3 14 3 7 14 9 3 11 13 14 8 2 14 14 6 2 16 4 3 7 5 16 1 9 10 13 15
output:
1 7 1 5 1 4 1 3 1 2 1 2 1 2 1 2
result:
ok 16 lines
Test #13:
score: 0
Accepted
time: 0ms
memory: 13496kb
input:
16 1 7 15 1 8 1 15 12 7 2 1 13 13 14 12 3 3 16 11 3 9 3 10 12 2 5 6 7 9 4
output:
1 9 1 7 1 5 1 5 1 4 1 3 1 3 1 2
result:
ok 16 lines
Test #14:
score: 0
Accepted
time: 2ms
memory: 13496kb
input:
14 8 11 11 5 7 5 7 3 3 12 12 2 2 14 14 6 3 1 9 12 6 13 10 1 4 7
output:
1 10 1 8 1 6 1 4 1 3 1 2 1 1
result:
ok 14 lines
Test #15:
score: 0
Accepted
time: 0ms
memory: 13520kb
input:
14 6 8 9 8 1 9 1 3 3 10 5 10 13 5 11 13 11 12 12 14 7 14 4 7 4 2
output:
1 14 1 12 1 10 1 8 1 6 1 4 1 2
result:
ok 14 lines
Test #16:
score: 0
Accepted
time: 0ms
memory: 13292kb
input:
15 4 7 7 3 15 7 7 14 10 7 7 1 13 7 8 7 7 9 6 7 1 5 4 12 2 3 10 11
output:
1 5 1 3 1 1 1 1 1 1 1 1 1 1 1
result:
ok 15 lines
Test #17:
score: 0
Accepted
time: 0ms
memory: 13328kb
input:
16 14 7 15 14 14 5 14 2 14 12 11 14 13 14 14 10 3 14 14 9 14 16 14 6 1 14 14 8 4 14
output:
1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1
result:
ok 16 lines
Test #18:
score: 0
Accepted
time: 0ms
memory: 13520kb
input:
16 4 9 9 10 10 6 16 6 4 5 5 14 14 15 5 7 8 14 14 13 11 5 5 12 5 2 5 1 3 5
output:
1 8 1 6 1 5 1 4 1 2 1 1 1 1 1 1
result:
ok 16 lines
Test #19:
score: 0
Accepted
time: 5ms
memory: 13528kb
input:
15 4 15 4 10 1 4 5 4 4 12 14 4 11 4 4 13 13 9 6 9 6 7 2 13 2 8 3 2
output:
1 6 1 4 1 3 1 2 1 2 1 2 1 2 1
result:
ok 15 lines
Test #20:
score: 0
Accepted
time: 0ms
memory: 13456kb
input:
16 1 2 2 5 12 2 2 15 14 2 2 11 6 2 10 2 10 4 13 4 16 13 10 9 9 7 9 3 8 3
output:
1 7 1 5 1 3 1 3 1 2 1 2 1 2 1 2
result:
ok 16 lines
Test #21:
score: 0
Accepted
time: 0ms
memory: 13324kb
input:
15 11 15 15 6 15 12 15 2 15 14 9 15 7 15 13 15 4 1 4 3 13 3 8 13 10 8 5 10
output:
1 7 1 5 1 3 1 2 1 2 1 2 1 2 1
result:
ok 15 lines
Subtask #2:
score: 16
Accepted
Dependency #1:
100%
Accepted
Test #22:
score: 16
Accepted
time: 7ms
memory: 14992kb
input:
3985 2388 2281 2388 3669 2448 3669 2448 2962 3147 2448 2166 2388 209 3147 2325 2388 1584 3147 1349 3669 3525 3147 2962 2698 1349 660 2281 553 3454 3147 2325 3651 3339 2281 2281 3565 1584 1621 1584 2118 819 3339 72 2166 2025 660 553 2331 3266 209 2166 2930 2432 3454 3677 3525 368 1349 553 519 3677 28...
output:
1 34 1 32 1 31 1 30 1 29 1 28 1 28 1 28 1 28 1 27 1 27 1 27 1 27 1 27 1 27 1 27 1 26 1 26 1 25 1 25 1 24 1 24 1 23 1 23 1 23 1 23 1 22 1 22 1 22 1 22 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 19 1 19 1 19 1 19 1 19 1 19 1 19 1 19 1 19 1 19 1 18 1 18 1 18 1 18 1 18 ...
result:
ok 3985 lines
Test #23:
score: 0
Accepted
time: 0ms
memory: 14868kb
input:
3986 1021 3515 726 1021 757 1021 1483 1021 483 1483 3239 483 1021 2531 757 1622 483 2480 90 1622 483 3977 90 3459 757 1821 761 3239 3022 757 726 669 2327 90 3585 3022 279 3977 3977 2484 846 1622 1021 2639 2754 3515 1176 1021 96 483 3585 3604 2327 1741 2327 1759 2480 2457 2327 306 3977 3422 1233 3977...
output:
1 35 1 33 1 31 1 29 1 29 1 28 1 28 1 28 1 26 1 26 1 26 1 25 1 24 1 24 1 24 1 24 1 24 1 24 1 23 1 23 1 23 1 22 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 19 1 19 1 19 1 19 1 19 1 19 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 ...
result:
ok 3986 lines
Test #24:
score: 0
Accepted
time: 0ms
memory: 14880kb
input:
3942 2742 1586 1768 2742 1586 3325 1768 673 3166 673 1392 3166 1764 2742 3846 673 673 24 24 1880 3325 2461 180 24 2461 1825 1586 3232 369 3325 2322 24 180 1198 36 1825 1880 865 3625 865 3325 2289 3625 1318 1825 1393 1309 36 88 1768 36 570 2588 570 36 3621 3925 1764 1090 2742 674 570 180 3150 118 362...
output:
1 43 1 41 1 39 1 37 1 37 1 36 1 35 1 34 1 34 1 34 1 33 1 33 1 32 1 32 1 32 1 31 1 31 1 31 1 30 1 30 1 30 1 29 1 28 1 28 1 28 1 28 1 28 1 28 1 28 1 28 1 28 1 28 1 28 1 28 1 28 1 28 1 28 1 28 1 27 1 26 1 26 1 26 1 26 1 26 1 26 1 26 1 26 1 26 1 26 1 26 1 26 1 26 1 26 1 26 1 26 1 26 1 24 1 24 1 24 1 24 ...
result:
ok 3942 lines
Test #25:
score: 0
Accepted
time: 3ms
memory: 14956kb
input:
3960 750 291 750 1350 2287 291 2287 1155 590 1350 1350 2483 590 2452 3626 291 291 249 2287 570 491 590 2491 1155 1155 870 1155 2397 750 259 491 3488 3488 1848 3107 750 705 3626 570 3649 3411 2397 2483 3770 1415 590 454 3488 2960 1350 259 2224 1415 648 2254 491 2864 705 249 1567 275 1350 2757 491 107...
output:
1 30 1 28 1 27 1 25 1 24 1 23 1 22 1 22 1 22 1 20 1 20 1 20 1 20 1 20 1 19 1 19 1 19 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 17 1 17 1 17 1 17 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 15 1 15 1 15 1 15 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 14 ...
result:
ok 3960 lines
Test #26:
score: 0
Accepted
time: 3ms
memory: 14984kb
input:
3949 3764 3701 2864 3701 1554 3701 578 2864 3701 3539 3539 1974 3539 88 3701 1236 578 2111 3012 88 1895 3764 273 1236 1174 2864 222 578 1895 3149 3539 2629 3429 2111 1544 3429 1554 190 2069 2111 1236 3542 578 3658 2762 1974 3424 1895 1133 2762 3658 3527 1895 696 2721 2762 3539 452 88 3610 2721 3147 ...
output:
1 31 1 29 1 29 1 27 1 26 1 26 1 25 1 24 1 24 1 24 1 23 1 23 1 22 1 21 1 21 1 21 1 21 1 21 1 21 1 20 1 19 1 19 1 19 1 19 1 19 1 19 1 19 1 19 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 16 1 16 1 16 1 15 1 14 1 14 1 14 1 14 1 14 1 14 1 14 1 13 1 13 1 13 ...
result:
ok 3949 lines
Test #27:
score: 0
Accepted
time: 6ms
memory: 14980kb
input:
4000 3523 3550 3523 3231 1960 3523 308 3550 3766 1960 3638 3550 1398 308 308 172 3550 3214 3638 3212 1973 3231 448 172 3214 1726 2761 3550 1792 3212 1973 538 3231 1838 3491 2761 172 1551 2340 448 1484 2761 3214 2034 448 2208 189 3212 800 3550 3214 1033 189 1504 2051 3638 941 1726 1805 1398 230 538 3...
output:
1 34 1 32 1 31 1 29 1 29 1 28 1 27 1 26 1 26 1 26 1 26 1 26 1 25 1 25 1 25 1 24 1 24 1 24 1 24 1 24 1 22 1 22 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 20 1 19 1 19 1 19 1 19 1 19 1 19 1 19 1 19 1 19 1 19 1 18 1 18 1 18 1 18 1 18 ...
result:
ok 4000 lines
Test #28:
score: 0
Accepted
time: 3ms
memory: 14996kb
input:
4000 2627 2898 2898 314 3345 2627 314 2466 3345 1095 3031 314 1095 2542 3074 2627 3391 3031 2898 89 3314 2898 3415 2898 2542 12 49 314 2361 314 2131 2361 3031 920 2131 2303 3074 368 3915 1095 565 12 89 284 2303 1975 2312 2466 2131 3901 3481 12 3712 2627 49 3860 350 2131 3031 3489 686 2361 3415 340 3...
output:
1 33 1 31 1 29 1 29 1 28 1 26 1 26 1 26 1 26 1 24 1 24 1 24 1 24 1 24 1 24 1 23 1 22 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 21 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 19 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 17 1 17 1 17 1 17 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 ...
result:
ok 4000 lines
Test #29:
score: 0
Accepted
time: 0ms
memory: 14876kb
input:
4000 2089 2753 2753 1171 3685 2753 2089 584 2089 2113 2865 3685 2113 3150 1828 2089 2753 170 227 2089 157 2753 584 906 3150 2429 2113 2332 227 2972 227 1358 2478 906 2113 3791 170 273 1171 3846 1358 3727 2972 1844 1989 2865 3791 2995 2933 3685 1171 3992 584 682 2865 1771 256 3150 796 584 614 1844 27...
output:
1 31 1 29 1 27 1 26 1 26 1 26 1 25 1 25 1 24 1 24 1 23 1 23 1 23 1 22 1 22 1 20 1 19 1 18 1 18 1 18 1 18 1 18 1 18 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 14 1 13 1 13 1 13 1 13 1 13 1 13 1 13 1 13 1 13 1 13 ...
result:
ok 4000 lines
Test #30:
score: 0
Accepted
time: 3ms
memory: 14824kb
input:
4000 3023 347 697 347 697 3559 3559 1639 3344 697 347 3237 2644 347 697 3054 64 3023 697 767 2417 2644 1993 3237 380 2417 140 3054 2900 1993 1483 3559 1515 3054 3395 2417 347 3304 697 2805 3559 3519 2644 196 3989 2417 2805 2464 1326 2417 2900 1703 2496 697 767 3098 790 196 954 1326 219 1639 790 31 3...
output:
1 32 1 30 1 28 1 27 1 26 1 26 1 24 1 24 1 23 1 23 1 23 1 22 1 22 1 22 1 21 1 21 1 20 1 20 1 20 1 20 1 19 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 18 1 17 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 1 15 ...
result:
ok 4000 lines
Test #31:
score: 0
Accepted
time: 3ms
memory: 14876kb
input:
4000 609 943 2191 943 609 3385 3560 609 3385 3309 3278 609 609 3625 2260 2191 943 1008 1626 2191 2332 3278 1305 609 1386 3625 1008 503 3278 45 3309 1355 3222 3625 2260 3488 2547 3222 2260 1154 3385 2503 1038 3625 2503 3211 1305 2011 2332 3944 1355 190 2187 3385 2187 1252 3211 625 1843 3488 943 2650 ...
output:
1 33 1 31 1 29 1 27 1 26 1 26 1 26 1 25 1 24 1 23 1 22 1 22 1 22 1 22 1 21 1 20 1 20 1 20 1 20 1 20 1 19 1 19 1 19 1 19 1 19 1 19 1 18 1 18 1 18 1 18 1 18 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 17 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 16 1 15 1 15 1 15 1 15 1 15 1 15 ...
result:
ok 4000 lines
Test #32:
score: 0
Accepted
time: 3ms
memory: 15024kb
input:
3999 3551 1490 2942 1490 2942 2444 1082 2444 2671 1082 2671 500 500 316 3049 316 3049 3475 3515 3475 3515 982 982 2792 2792 1105 1105 3699 3699 506 651 506 2766 651 2766 2563 1176 2563 1176 430 1543 430 3814 1543 3814 2327 3925 2327 3925 2880 2880 2300 3098 2300 3098 2635 2635 3567 3567 2168 1216 21...
output:
1 2321 1 2319 1 2318 1 2318 1 2317 1 2316 1 2314 1 2313 1 2311 1 2311 1 2309 1 2308 1 2306 1 2304 1 2302 1 2301 1 2301 1 2299 1 2297 1 2297 1 2297 1 2297 1 2295 1 2294 1 2294 1 2293 1 2291 1 2289 1 2288 1 2287 1 2286 1 2286 1 2285 1 2285 1 2284 1 2284 1 2283 1 2282 1 2281 1 2279 1 2278 1 2277 1 2277...
result:
ok 3999 lines
Test #33:
score: 0
Accepted
time: 3ms
memory: 15040kb
input:
3999 3918 3738 3738 3159 3784 3159 3784 111 111 254 2011 254 2011 3528 439 3528 3108 439 3206 3108 2525 3206 2562 2525 653 2562 3387 653 2559 3387 1694 2559 1694 58 2863 58 2863 230 230 1722 3589 1722 3589 876 2498 876 2498 1843 1843 3798 3798 406 406 3467 464 3467 464 335 335 3457 3566 3457 3566 33...
output:
1 3999 1 3997 1 3995 1 3993 1 3991 1 3989 1 3987 1 3985 1 3983 1 3981 1 3979 1 3977 1 3975 1 3973 1 3971 1 3969 1 3967 1 3965 1 3963 1 3961 1 3959 1 3957 1 3955 1 3953 1 3951 1 3949 1 3947 1 3945 1 3943 1 3941 1 3939 1 3937 1 3935 1 3933 1 3931 1 3929 1 3927 1 3925 1 3923 1 3921 1 3919 1 3917 1 3915...
result:
ok 3999 lines
Test #34:
score: 0
Accepted
time: 3ms
memory: 14908kb
input:
3999 2214 374 374 2802 734 374 374 600 374 348 2277 374 374 672 374 3440 3264 374 374 3690 374 3344 374 884 2491 374 1489 374 374 3417 2379 374 374 2966 374 1772 374 1300 3835 374 374 1182 3615 374 1101 374 3854 374 2158 374 1485 374 374 1728 374 579 374 2092 2766 374 374 3159 3611 374 3258 374 374 ...
output:
1 14 1 12 1 11 1 11 1 9 1 8 1 7 1 6 1 4 1 4 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 3999 lines
Test #35:
score: 0
Accepted
time: 3ms
memory: 15128kb
input:
4000 2958 816 90 2958 2958 1232 2958 3524 14 2958 2958 3175 3375 2958 1924 2958 3815 2958 1291 2958 2958 3618 301 2958 2958 580 2958 3945 3851 2958 2958 2466 2958 2968 2958 1472 2958 2235 456 2958 2958 2654 2958 350 2958 274 2958 373 2958 2422 2958 3589 2958 1283 2958 2903 2658 2958 3980 2958 2958 1...
output:
1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 4000 lines
Test #36:
score: 0
Accepted
time: 3ms
memory: 14964kb
input:
4000 3280 1562 3962 3280 3962 3612 2987 3612 2987 1483 1483 453 453 1853 3554 1853 3349 3554 3349 3321 3321 2907 1224 2907 2835 1224 3372 2835 809 3372 809 2413 744 2413 3342 744 3342 2722 2722 3799 477 3799 1855 477 1855 3736 3736 2680 2680 499 499 2645 2645 1643 1643 426 690 426 690 560 560 2486 8...
output:
1 176 1 174 1 173 1 172 1 170 1 169 1 167 1 166 1 164 1 163 1 161 1 160 1 158 1 157 1 155 1 154 1 152 1 151 1 149 1 148 1 146 1 145 1 143 1 142 1 140 1 139 1 137 1 136 1 134 1 133 1 131 1 130 1 128 1 127 1 125 1 124 1 122 1 121 1 119 1 118 1 116 1 115 1 113 1 112 1 110 1 109 1 107 1 106 1 104 1 103 ...
result:
ok 4000 lines
Test #37:
score: 0
Accepted
time: 3ms
memory: 15024kb
input:
4000 3203 2979 2436 2979 2635 2979 2020 2979 2979 962 1025 2979 3728 2979 531 2979 2979 847 2979 1896 2979 2707 2979 679 1720 2979 2979 2187 2979 2340 2740 2979 3023 2979 2979 2202 2979 3983 2979 3820 2979 31 2979 646 244 2979 2972 2979 2979 2605 831 2979 2979 2218 2979 41 2979 3840 635 2979 2979 21...
output:
1 30 1 28 1 27 1 26 1 25 1 24 1 24 1 24 1 24 1 24 1 24 1 24 1 24 1 24 1 24 1 24 1 24 1 24 1 24 1 23 1 22 1 21 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 20 1 19 1 18 1 17 1 16 1 16 1 16 1 16 ...
result:
ok 4000 lines
Test #38:
score: 0
Accepted
time: 7ms
memory: 14944kb
input:
3999 1409 586 479 1409 3623 1409 3156 1409 1409 501 1409 230 1409 2776 1409 3132 1409 1130 1727 1409 1409 2829 1409 3176 1409 159 1409 3809 1409 1619 1409 811 2322 1409 3090 1409 2300 1409 1409 215 2407 1409 1409 1553 1409 659 3403 1409 2222 1409 1409 418 1409 98 1409 1238 1479 1409 1409 3883 3320 1...
output:
1 1999 1 1997 1 1995 1 1993 1 1991 1 1989 1 1987 1 1985 1 1983 1 1981 1 1979 1 1977 1 1975 1 1973 1 1971 1 1969 1 1967 1 1965 1 1963 1 1961 1 1959 1 1957 1 1955 1 1953 1 1951 1 1949 1 1947 1 1945 1 1943 1 1941 1 1939 1 1937 1 1935 1 1933 1 1931 1 1929 1 1927 1 1925 1 1923 1 1921 1 1919 1 1917 1 1915...
result:
ok 3999 lines
Subtask #3:
score: 0
Runtime Error
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Test #39:
score: 0
Runtime Error
input:
196145 73351 68596 144883 68596 144883 77440 158554 77440 70653 73351 84095 77440 84095 107513 10720 73351 43180 77440 77440 172445 144883 18265 190722 10720 38486 84095 1238 68596 68596 53427 73990 70653 38486 182078 121987 190722 182693 190722 190722 22959 119892 68596 158028 144883 10720 49607 10...