QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#759423 | #9718. Escape from the Island | rotcar07 | AC ✓ | 198ms | 42516kb | C++23 | 1.2kb | 2024-11-18 08:07:14 | 2024-11-18 08:07:15 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
constexpr int maxn=1e5+5;
int n,m,k,dis[maxn*51],deg[maxn];bool vis[maxn*51];
vector<int> e[maxn],g[maxn];
inline void solve(){
cin>>n>>m>>k;
for(int i=0;i<n*(k+1);i++) dis[i]=vis[i]=0;
for(int i=1;i<=n;i++) e[i].clear(),deg[i]=0,g[i].clear();
for(int i=1,u,v;i<=m;i++) cin>>u>>v,e[u].push_back(v),e[v].push_back(u),deg[u]++,g[v].push_back(u);
queue<int> q;
auto upd=[&](int x,int y,int d){
// cout<<x<<" "<<y<<' '<<d<<'\n';
int z=(x-1)*(k+1)+y;
if(!vis[z]) dis[z]=d,vis[z]=1,q.push(z);
};
for(int i=0;i<=k;i++)upd(n,i,0);
while(!q.empty()){
int p=q.front();q.pop();
int u=p/(k+1)+1,v=p%(k+1),d=dis[p]+1;
if(!v){
if(!deg[u])for(int i=1;i<=k;i++)upd(u,i,d);
for(int x:g[u])if(!--deg[x])for(int i=0;i<=k;i++) upd(x,i,d);
}
else for(int x:e[u])upd(x,v-1,d);
}
for(int i=1;i<=n;i++){
int mn=1e9;
for(int j=0;j<=k;j++)if(vis[(i-1)*(k+1)+j]) mn=min(mn,dis[(i-1)*(k+1)+j]);
cout<<(mn==1e9?-1:mn)<<'\n';
}
}
int main(){
int t;cin>>t;
for(int _=1;_<=t;_++) cout<<"Case #"<<_<<": \n",solve();
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 9928kb
input:
3 3 3 1 1 2 2 3 1 3 3 2 1 2 1 3 2 4 3 2 2 1 3 2 4 3
output:
Case #1: 1 1 0 Case #2: -1 1 0 Case #3: 5 2 1 0
result:
ok 13 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 7768kb
input:
1 4 4 1 1 2 2 3 3 1 3 4
output:
Case #1: 3 2 1 0
result:
ok 5 lines
Test #3:
score: 0
Accepted
time: 1ms
memory: 9776kb
input:
1 6 7 1 1 2 1 3 3 4 3 5 4 6 5 6 2 6
output:
Case #1: 2 1 2 1 1 0
result:
ok 7 lines
Test #4:
score: 0
Accepted
time: 1ms
memory: 7880kb
input:
1 6 6 2 2 1 3 2 6 3 4 1 4 5 6 5
output:
Case #1: 4 2 1 2 1 0
result:
ok 7 lines
Test #5:
score: 0
Accepted
time: 1ms
memory: 7600kb
input:
2 3 2 1 1 2 3 2 5 5 2 1 2 1 3 3 1 3 4 5 4
output:
Case #1: 2 1 0 Case #2: 4 7 2 1 0
result:
ok 10 lines
Test #6:
score: 0
Accepted
time: 0ms
memory: 7748kb
input:
1 7 7 2 2 1 3 2 6 3 7 6 4 1 4 5 7 5
output:
Case #1: 4 5 2 2 1 1 0
result:
ok 8 lines
Test #7:
score: 0
Accepted
time: 2ms
memory: 9972kb
input:
10 87 86 7 67 9 31 40 54 87 44 25 58 66 41 28 47 43 19 6 10 54 57 87 36 77 1 61 43 81 26 71 12 61 37 81 14 78 86 57 28 70 75 41 34 82 82 69 52 81 55 29 81 1 7 32 40 28 8 75 60 82 59 38 42 25 24 87 3 52 50 79 5 23 30 79 78 41 61 57 65 1 39 52 56 52 73 11 62 12 9 70 29 57 49 4 18 38 35 51 74 87 66 53 ...
output:
Case #1: 3 5 6 2 8 7 4 8 5 2 3 3 2 8 4 8 6 9 8 6 6 2 7 1 4 8 6 5 2 2 7 3 2 4 4 4 5 8 6 6 6 5 5 5 7 6 6 4 3 2 3 5 2 1 3 6 1 4 9 4 2 4 2 2 4 3 6 9 2 4 7 4 4 1 7 1 3 7 1 4 4 3 7 7 4 2 0 Case #2: 2 4 4 5 1 2 2 3 1 1 3 1 4 1 2 2 2 3 2 2 1 4 2 3 2 3 3 1 1 3 2 3 3 2 2 3 2 3 1 1 2 1 3 2 3 3 2 2 2 1 2 2 2 ...
result:
ok 880 lines
Test #8:
score: 0
Accepted
time: 1ms
memory: 7660kb
input:
10 7 42 0 6 3 1 6 1 4 3 4 5 2 4 2 2 3 7 1 2 6 5 1 2 7 5 3 3 1 4 3 6 5 7 4 7 3 1 2 6 2 2 1 4 7 6 4 5 4 3 2 2 5 3 7 5 6 4 6 7 5 4 5 3 5 3 6 6 7 6 1 7 2 2 4 7 6 1 3 4 1 1 7 1 5 5 7 7 42 0 5 3 2 4 5 4 2 5 7 1 2 3 7 2 2 7 7 4 4 5 6 5 4 7 4 6 4 3 6 1 2 1 1 7 7 5 2 6 3 7 7 3 1 6 6 7 3 5 1 5 1 4 6 4 5 7 1 3...
output:
Case #1: -1 -1 -1 -1 -1 -1 0 Case #2: -1 -1 -1 -1 -1 -1 0 Case #3: -1 -1 -1 -1 -1 -1 0 Case #4: -1 -1 -1 -1 -1 -1 0 Case #5: -1 -1 -1 -1 -1 -1 0 Case #6: -1 -1 -1 -1 -1 -1 0 Case #7: -1 -1 -1 -1 -1 -1 0 Case #8: -1 -1 -1 -1 -1 -1 0 Case #9: -1 -1 -1 -1 -1 -1 0 Case #10: -1 -1 -1 -1 -1 -1 0
result:
ok 80 lines
Test #9:
score: 0
Accepted
time: 55ms
memory: 13072kb
input:
3 29089 29088 13 14880 25221 13082 11105 4630 15558 5420 21033 24701 3765 18656 6122 26366 3411 8863 8729 28452 1035 23728 22231 16508 6127 13176 27205 16088 24962 8059 14896 11386 22022 21 28134 24066 11514 19450 3535 11612 6757 712 11192 22182 26294 19554 22627 1691 6518 26715 16489 26179 25251 33...
output:
Case #1: 33 22 29 31 24 26 28 24 28 35 30 27 33 29 31 21 40 32 34 29 26 20 32 19 36 20 32 22 38 31 29 24 18 30 42 40 26 35 31 28 27 22 20 32 25 31 29 27 39 20 21 38 26 29 26 28 30 27 31 30 29 33 29 32 27 27 29 29 27 37 21 30 36 34 33 38 23 27 36 27 12 28 28 26 20 21 28 19 37 25 25 29 20 25 42 34 27...
result:
ok 87270 lines
Test #10:
score: 0
Accepted
time: 32ms
memory: 9788kb
input:
1 6579 68577 17 1794 2771 3529 6299 950 2289 3037 5595 809 3379 229 4912 4002 5005 1367 95 5134 2539 3504 3958 516 2285 1884 1994 2980 4611 5276 239 4572 1571 1182 1622 4646 1282 1068 175 5179 1999 1328 240 2100 256 442 641 2973 3685 4740 3794 4194 4161 5884 2724 2409 422 697 155 1502 621 1657 574 1...
output:
Case #1: 3 3 4 3 3 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 2 3 3 4 3 2 3 3 3 3 2 3 3 3 3 3 2 3 3 3 2 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 2 2 4 3 4 2 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 2 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 2 3 3 3 3 2 3 3 3 2 3 3 2 3 ...
result:
ok 6580 lines
Test #11:
score: 0
Accepted
time: 109ms
memory: 36060kb
input:
1 85539 87724 47 65880 24309 28763 38226 51057 26348 11214 35653 27280 21394 65638 66597 50381 25879 344 50798 12195 70651 75413 40671 22200 66912 77776 13178 81241 69520 70303 47199 46744 69290 75400 12282 6127 78800 66444 30959 77407 28105 68317 29830 59297 8522 19119 20837 41905 42887 41741 31029...
output:
Case #1: 18 22 27 25 18 18 22 23 22 14 18 16 20 23 19 18 18 18 25 21 16 16 23 19 17 17 25 23 28 23 22 24 19 13 20 11 11 18 21 17 20 16 15 19 25 19 19 22 20 19 17 15 12 14 12 18 18 21 22 19 23 21 24 24 17 18 15 22 23 17 21 23 21 21 14 20 16 17 15 22 19 20 17 22 20 19 21 24 21 23 25 21 16 19 15 17 18...
result:
ok 85540 lines
Test #12:
score: 0
Accepted
time: 50ms
memory: 17172kb
input:
1 81636 97497 0 32408 33206 64255 78377 77774 46133 136 56181 43083 883 64259 46308 34088 20817 66100 1085 42023 75378 36828 48836 14418 15444 10864 37956 12574 17587 4261 10663 45783 21776 8858 52663 48742 21471 50688 2147 28007 40310 44625 59687 40425 75318 53729 26324 71785 69866 68759 7351 66857...
output:
Case #1: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 7 7 10 -1 -1 -1 -1 -1 -1 -1 -1 10 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 11 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 13 -1 -1 -1 -1 -1 17 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 12 -1 -1 -1 -1 -1 -1 -1 -1 10 -1 -1 -1 -1 -1 -1 -...
result:
ok 81637 lines
Test #13:
score: 0
Accepted
time: 55ms
memory: 18712kb
input:
1 100000 100000 1 83875 8711 25951 70558 57082 13656 51228 26061 71368 31966 15096 48024 44979 56341 93953 7617 749 28699 98370 71906 45255 74344 2151 78824 55283 73963 99424 69076 73035 62768 14390 56319 84653 47388 98599 54258 56539 70999 93857 80077 23337 40390 26222 71307 15754 18485 2793 17692 ...
output:
Case #1: 4 8 8 7 7 6 6 6 5 9 7 9 10 8 8 8 6 6 6 9 8 4 8 9 7 6 8 5 6 5 6 8 10 7 8 7 4 8 9 9 4 7 5 5 6 9 7 9 8 11 5 6 9 8 8 5 4 8 8 8 9 4 5 7 8 7 8 6 5 5 7 4 7 7 7 4 7 8 7 10 7 5 9 4 7 8 7 7 5 7 4 7 7 7 8 8 9 9 8 9 9 6 8 6 6 7 5 8 9 7 5 6 8 4 7 8 5 6 7 5 6 8 8 8 8 7 8 7 7 10 4 9 6 6 8 7 7 6 7 7 5 6 6...
result:
ok 100001 lines
Test #14:
score: 0
Accepted
time: 93ms
memory: 29196kb
input:
1 100000 100000 25 48585 264 44509 86562 32367 39067 87088 64393 67504 6246 89583 17039 55138 148 67024 28032 67977 16093 60836 12489 3994 84023 22245 60854 26114 6623 32296 33757 52145 33805 38452 51414 96234 70952 50314 77620 79198 2477 17239 4437 6408 63369 50887 95680 73832 71566 61071 63463 500...
output:
Case #1: 20 20 21 5 16 17 20 23 15 22 18 10 15 17 22 21 17 27 21 16 22 19 32 13 24 20 25 20 22 18 19 23 19 22 22 22 12 22 21 21 26 24 23 24 17 21 15 24 21 23 23 21 18 17 22 16 27 24 19 30 22 23 17 14 18 16 22 22 21 20 14 17 18 22 19 20 18 19 19 25 21 20 21 17 21 14 18 18 19 27 16 29 20 16 20 18 21 ...
result:
ok 100001 lines
Test #15:
score: 0
Accepted
time: 66ms
memory: 18700kb
input:
1 100000 100000 3 85031 6646 83717 14364 77636 85229 474 45782 56255 76322 56209 5444 73037 6196 51459 47411 47295 30527 65946 21906 6420 57168 72573 7717 58842 57059 85121 77404 8473 56276 2797 92540 26403 45349 55089 50321 93106 4883 44808 49509 60815 31424 76446 54973 42044 98007 51671 20316 4103...
output:
Case #1: 10 7 8 17 12 14 10 17 18 15 10 18 12 20 13 16 15 16 16 12 8 11 15 12 14 16 14 9 11 7 15 14 10 15 5 11 24 9 11 9 8 10 8 17 6 8 13 15 13 13 11 7 15 14 5 8 12 13 13 14 11 13 11 8 9 13 15 13 20 8 10 6 20 14 14 9 10 17 7 11 10 15 10 14 13 6 16 16 10 16 20 16 13 9 18 10 13 10 7 12 15 6 8 5 13 15...
result:
ok 100001 lines
Test #16:
score: 0
Accepted
time: 113ms
memory: 36824kb
input:
1 100000 100000 41 37536 99658 34375 48213 97325 11374 51584 94236 88411 11845 31583 20064 5137 20561 75133 70847 8215 3064 60317 52504 78325 31535 18980 91521 58669 53453 60959 8571 40970 36489 20342 87826 1942 51274 52570 98696 68733 55677 13781 98399 77703 70652 49908 82797 80922 47543 46576 3024...
output:
Case #1: 17 27 27 27 29 34 23 36 23 28 20 33 29 22 31 27 29 33 22 29 24 28 22 27 16 33 23 26 24 32 28 28 25 17 25 22 28 19 34 27 25 30 28 33 30 27 22 31 34 40 18 33 26 29 15 33 28 24 31 17 22 26 30 16 25 30 26 23 32 27 18 18 27 30 24 28 23 29 30 27 25 22 30 24 30 24 30 35 28 30 30 27 31 18 23 26 16...
result:
ok 100001 lines
Test #17:
score: 0
Accepted
time: 2ms
memory: 7952kb
input:
10 98 97 10 93 71 29 35 43 11 96 71 73 31 56 90 1 54 74 66 15 6 47 2 46 97 82 90 17 86 24 35 18 31 82 28 27 22 77 58 59 77 91 92 83 85 26 13 40 36 57 3 71 68 32 40 38 82 82 79 47 61 43 81 84 78 90 78 28 50 75 70 26 36 66 62 7 27 27 35 8 89 20 6 67 27 43 83 43 16 45 2 21 56 34 75 90 86 5 70 34 49 65 ...
output:
Case #1: 6 7 8 10 9 8 11 12 4 6 3 6 8 6 9 3 6 9 11 9 6 12 10 10 12 7 10 6 10 5 8 8 5 10 9 6 13 6 14 7 5 6 2 7 8 9 6 7 11 7 7 9 4 7 10 5 9 6 4 5 5 13 10 7 10 12 11 10 9 8 9 8 9 11 9 9 5 5 6 14 1 5 3 6 4 5 7 10 13 4 5 6 8 10 12 10 8 0 Case #2: 5 13 8 3 9 12 8 3 8 14 12 10 4 6 12 13 6 11 11 10 13 7 7...
result:
ok 990 lines
Test #18:
score: 0
Accepted
time: 2ms
memory: 7720kb
input:
10 18 298 2 14 10 17 15 10 14 14 4 18 6 5 8 14 8 18 1 6 5 17 12 14 15 18 9 14 12 6 9 16 8 4 9 9 14 1 9 8 4 7 9 3 1 1 13 11 1 15 4 13 18 5 10 2 3 14 1 9 4 13 10 14 11 9 18 13 9 15 11 6 10 10 8 7 6 4 3 2 8 1 16 5 2 2 18 13 17 17 4 4 16 12 9 1 12 2 6 1 17 13 7 6 1 3 15 4 15 5 14 12 11 7 16 11 17 8 13 1...
output:
Case #1: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 0 Case #2: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 0 Case #3: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 Case #4: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 Case #5: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 Case #6: 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 0 Case #7: 1 1 1 1 1 1 1 ...
result:
ok 190 lines
Test #19:
score: 0
Accepted
time: 50ms
memory: 10804kb
input:
3 26078 26077 8 14844 15475 12356 2826 25711 15380 4203 20944 11562 22872 12828 13676 10878 18785 4142 8673 6152 7905 4958 19348 18957 15624 8468 22969 12517 8785 8537 22897 5046 21691 12598 508 16137 6383 18686 4905 12799 14530 25314 4036 23906 23170 16630 3128 6091 5419 18971 13314 24552 3912 1540...
output:
Case #1: 8 14 14 12 15 20 12 17 16 15 17 14 14 16 14 13 20 15 14 17 16 17 16 16 17 17 15 16 8 15 15 12 14 15 14 15 12 13 14 17 14 15 13 15 14 18 12 11 13 17 14 14 13 20 15 16 17 14 16 14 17 16 10 13 11 21 13 21 22 15 11 18 12 12 13 13 15 15 12 14 17 16 14 17 14 13 11 13 16 15 15 17 12 15 13 13 14 1...
result:
ok 78237 lines
Test #20:
score: 0
Accepted
time: 18ms
memory: 11484kb
input:
1 3568 60763 37 872 1445 1584 742 2303 1682 186 1114 1920 2660 3147 740 835 629 1968 302 242 1103 555 382 77 1227 2651 2739 1120 173 220 1971 1104 3243 2888 2031 456 50 3398 595 280 1141 1167 1888 1881 762 1456 537 1189 3232 820 1730 1082 2207 1242 1988 1331 1112 35 1128 165 789 2432 2015 228 2806 2...
output:
Case #1: 4 4 3 3 4 3 3 3 4 3 3 3 3 4 3 4 3 3 4 4 4 3 3 3 3 3 4 4 4 3 3 4 3 4 4 3 4 4 2 4 3 3 3 3 4 4 3 4 3 3 4 3 3 4 3 3 4 4 4 4 3 4 3 3 3 3 4 4 3 4 3 4 4 3 3 4 3 3 3 4 4 3 4 3 4 3 3 4 3 3 4 3 4 3 4 3 3 3 4 3 3 3 3 4 4 3 4 4 4 4 2 3 4 4 3 4 4 3 3 4 3 3 4 3 4 4 4 4 3 3 3 4 3 3 4 4 3 3 3 3 2 3 4 3 4 ...
result:
ok 3569 lines
Test #21:
score: 0
Accepted
time: 129ms
memory: 37676kb
input:
1 99272 99293 42 21252 77603 83422 65279 13595 92166 73199 3510 21909 10326 80194 48541 31469 53440 89601 22343 47937 20639 56469 86578 83547 117 44018 85693 33802 43558 45536 86021 64445 75338 84666 23456 64683 92883 29925 40763 54169 55786 46886 9952 93248 74774 3094 16488 7677 73432 15093 36000 8...
output:
Case #1: 25 52 51 10 49 50 51 48 49 47 39 55 49 51 51 50 47 36 45 40 50 36 49 43 49 45 40 49 50 50 40 44 30 54 31 44 47 54 50 61 43 29 49 44 43 50 49 39 54 50 44 35 31 46 54 32 33 46 42 46 39 51 44 41 46 36 47 40 47 40 46 54 43 44 53 39 47 38 30 33 32 49 41 47 48 51 53 53 41 40 45 29 49 46 47 40 48...
result:
ok 99273 lines
Test #22:
score: 0
Accepted
time: 179ms
memory: 40220kb
input:
1 95369 97612 46 18853 57141 65269 16303 60390 91859 58520 67423 27292 59609 25993 78125 65924 22310 22244 53559 93564 54598 27015 65581 48514 10647 12685 85601 73076 33758 35890 44225 60236 24406 41307 16197 3318 93798 76074 27629 49181 57031 14940 65987 50303 10161 40552 63291 71033 80855 12236 87...
output:
Case #1: 8 14 14 12 14 14 15 15 14 15 13 13 12 12 17 10 17 13 11 14 14 12 15 10 12 12 14 16 15 11 14 12 15 13 15 13 15 14 13 16 13 16 14 11 16 14 18 19 12 15 13 14 14 11 13 12 14 17 12 11 16 15 9 11 7 10 8 12 10 12 12 13 14 10 15 13 13 14 12 14 14 13 13 14 17 14 13 13 15 15 10 16 15 13 14 12 13 13 ...
result:
ok 95370 lines
Test #23:
score: 0
Accepted
time: 112ms
memory: 27960kb
input:
1 100000 100000 20 16586 16358 22364 95906 57643 35073 20519 47892 22696 43462 3839 11035 97619 35473 63581 44007 7354 92113 51542 28447 61003 47770 85208 20319 5886 48880 11339 48610 21558 97576 83937 4496 59147 90152 48072 35036 4200 8974 89845 20570 11636 43793 35231 93536 77130 22180 33410 60172...
output:
Case #1: 7 13 14 13 12 15 13 10 14 8 11 11 14 17 13 14 13 11 14 11 7 11 14 11 14 14 15 9 13 14 15 14 14 14 13 13 11 14 13 15 11 12 12 13 11 15 13 14 13 12 13 13 16 9 12 14 11 12 13 13 14 14 13 10 13 16 11 12 13 12 14 11 16 12 13 13 11 10 9 12 10 13 13 17 12 11 13 13 12 14 14 13 14 13 13 14 13 14 12...
result:
ok 100001 lines
Test #24:
score: 0
Accepted
time: 198ms
memory: 42516kb
input:
1 100000 100000 48 47034 46598 53281 38488 86622 81187 16310 92946 14927 94735 31671 4221 18488 80825 93993 70157 71342 23394 97220 59492 7982 92147 40494 47638 23666 28770 93511 23609 41224 1288 53333 89819 93656 37674 64818 56840 69800 56335 68531 38868 59295 5014 7304 17444 81876 10848 70967 6211...
output:
Case #1: 8 14 17 14 13 15 12 14 15 14 13 13 13 12 13 14 12 10 13 14 13 13 14 13 13 16 14 14 13 15 12 11 13 14 12 14 12 16 13 16 14 15 14 12 15 14 14 15 12 14 12 19 13 16 15 14 18 14 15 17 15 15 13 11 13 15 13 13 13 11 12 14 15 14 9 12 17 15 14 15 11 14 15 10 14 14 14 13 16 14 12 12 13 13 14 11 12 9...
result:
ok 100001 lines
Test #25:
score: 0
Accepted
time: 102ms
memory: 31608kb
input:
1 100000 100000 26 85838 53489 86046 37383 58286 42915 48575 53688 17349 80532 22623 93325 51751 10267 84303 57018 53753 62188 9111 74230 29176 9804 70722 974 19460 84566 96573 89370 56797 93348 25257 71995 61821 90477 65099 86972 80301 19435 28801 67910 4597 25212 24010 59758 4874 99492 63563 27576...
output:
Case #1: 18 31 33 43 28 32 24 33 26 29 28 38 31 34 38 36 33 22 26 39 40 26 44 43 36 22 32 25 30 39 26 26 22 31 29 26 37 37 24 30 26 39 35 32 32 21 28 39 36 32 31 29 27 40 31 21 33 19 36 23 27 22 28 39 24 41 28 38 39 29 45 18 34 26 46 26 26 29 22 25 23 28 26 38 32 40 28 34 41 24 25 29 31 26 25 32 35...
result:
ok 100001 lines
Test #26:
score: 0
Accepted
time: 170ms
memory: 38128kb
input:
1 100000 100000 39 57715 80550 2086 21557 81282 64853 80684 10487 33359 64257 87562 44753 19086 42227 75880 30783 27419 21326 45299 36956 8579 46724 16088 87287 77224 17845 65001 35540 40006 52068 3270 44230 72242 55844 83207 87569 18785 37604 41890 73124 72188 5711 72172 50911 23878 56953 60344 210...
output:
Case #1: 6 13 12 10 12 12 15 11 12 12 11 13 10 12 10 12 13 14 12 11 15 13 11 11 15 11 10 10 9 12 13 11 12 9 8 11 10 12 15 12 13 8 10 12 8 13 10 13 13 15 11 9 12 13 10 9 12 12 9 11 11 11 15 14 12 8 7 11 12 13 15 12 11 10 13 14 10 13 14 9 15 13 10 17 9 11 12 12 12 12 11 12 11 12 11 9 12 14 12 10 17 1...
result:
ok 100001 lines
Test #27:
score: 0
Accepted
time: 2ms
memory: 7948kb
input:
10 58 57 6 11 10 34 51 42 32 44 1 33 38 2 7 10 52 13 36 21 1 8 11 38 1 14 10 24 58 52 32 30 33 17 21 3 51 41 29 7 38 53 10 20 32 32 1 28 1 31 1 5 13 29 12 35 1 48 51 18 19 25 22 22 1 6 21 4 45 27 19 55 38 56 19 40 33 9 45 58 32 47 1 12 51 39 51 57 32 15 42 36 1 46 50 50 36 23 1 54 22 26 1 51 1 43 29...
output:
Case #1: 2 5 4 6 5 4 4 5 6 3 4 4 4 4 3 4 4 3 2 2 3 3 3 1 4 3 3 3 5 5 3 1 4 4 3 3 6 3 4 5 6 2 6 3 5 5 3 4 6 4 3 2 4 4 4 3 2 0 Case #2: 3 4 4 3 4 5 1 6 4 5 3 4 6 4 5 5 4 6 4 4 5 3 5 2 2 4 2 5 3 6 4 5 4 5 5 5 4 4 5 3 4 3 5 4 4 4 4 4 4 3 4 4 3 5 6 5 5 0 Case #3: 5 5 3 4 4 7 2 10 4 7 3 7 3 3 7 8 9 8 4...
result:
ok 590 lines
Test #28:
score: 0
Accepted
time: 5ms
memory: 7796kb
input:
10 44 1858 1 32 33 32 5 31 21 24 13 18 34 21 18 43 3 42 21 21 31 34 31 13 10 6 18 7 21 23 21 14 33 10 6 16 9 37 31 43 33 34 17 40 6 37 21 29 16 28 35 5 28 5 24 38 41 34 44 16 8 11 18 18 6 5 7 35 17 34 20 26 30 30 34 13 6 21 41 29 42 17 27 43 8 30 37 8 3 31 20 3 33 24 38 39 17 2 20 15 5 35 12 8 43 32...
output:
Case #1: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 -1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 Case #2: 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 -1 1 1 1 -1 -1 -1 1 1 0 Case #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 ...
result:
ok 450 lines
Test #29:
score: 0
Accepted
time: 43ms
memory: 11560kb
input:
2 40757 40756 3 15067 26085 17649 40391 19823 19520 22709 16300 32401 7124 15206 2500 27656 5578 8177 8750 32899 29850 7280 10444 15279 33184 35413 27 29998 15764 40425 3354 33270 28057 14337 37861 5612 8138 15048 6619 14427 38524 20277 39804 10670 3001 32793 29951 35808 9725 32835 24001 16269 21376...
output:
Case #1: 23 34 30 31 24 30 31 24 24 40 30 35 33 26 35 34 31 25 31 28 22 30 32 34 24 29 21 24 31 37 30 33 30 34 28 19 26 29 33 33 32 30 32 30 17 30 33 36 30 34 26 31 37 31 33 31 33 24 31 12 28 30 28 35 15 28 21 29 27 31 35 20 20 36 19 22 32 39 32 31 35 21 29 30 29 30 36 24 33 32 32 31 28 29 30 25 30...
result:
ok 81516 lines
Test #30:
score: 0
Accepted
time: 80ms
memory: 25880kb
input:
1 65049 77141 32 48706 45780 26899 27145 45299 49011 52220 27993 17247 16419 56989 45841 49418 6881 37676 28851 33607 56096 58474 19266 38185 64206 13880 28900 31379 61298 52403 15130 58059 24165 41257 8126 28788 39162 46285 28704 39638 41749 43674 43270 4397 54727 37697 25312 29530 58415 44104 6278...
output:
Case #1: 14 16 14 15 16 16 15 15 14 14 12 18 16 12 16 14 16 14 16 13 15 15 20 14 14 11 15 15 16 14 15 13 19 15 10 13 15 16 16 16 13 14 13 13 15 16 15 14 12 16 20 14 18 16 13 16 15 16 15 15 15 18 16 13 20 16 13 13 16 19 12 19 14 16 14 12 14 14 15 19 16 15 15 16 16 13 13 7 13 19 17 11 10 15 13 16 14 ...
result:
ok 65050 lines
Test #31:
score: 0
Accepted
time: 80ms
memory: 20928kb
input:
1 42551 76693 37 8236 19960 37417 16215 20019 11596 5812 1975 18531 22151 28615 37991 18148 35944 29258 26539 20032 26598 3621 38760 3380 17463 16236 36460 37753 3364 39315 9671 24546 15206 24391 18318 22329 40663 16979 22093 2184 6847 15977 15064 32865 14569 38432 29787 4881 1855 2835 15516 30697 2...
output:
Case #1: 6 7 8 7 6 8 9 9 7 6 7 8 9 8 10 9 11 9 8 8 5 10 10 6 9 7 9 10 10 9 8 9 10 8 10 8 10 8 6 10 9 7 9 9 9 8 8 10 6 9 8 10 9 9 10 9 8 9 9 9 8 8 7 9 10 6 6 10 8 8 9 9 7 10 8 10 9 7 10 8 8 7 9 6 8 8 9 8 8 9 9 10 9 7 9 7 7 7 8 9 7 9 8 8 9 6 9 8 7 9 8 8 7 9 6 6 9 9 9 9 8 7 8 8 6 8 10 7 9 5 8 8 8 9 9 ...
result:
ok 42552 lines
Test #32:
score: 0
Accepted
time: 60ms
memory: 17084kb
input:
1 38648 88999 15 19248 2646 20976 36444 23960 2118 5333 23243 6712 10714 24023 5513 36361 3609 16172 574 6435 19912 683 27177 19014 25911 33094 26296 1226 8054 7892 15305 3613 2499 31519 27467 1184 412 3377 3974 16538 6005 22765 19988 5784 9210 10947 23234 14435 7427 27097 31745 3460 6875 1923 11694...
output:
Case #1: 5 6 7 6 6 4 7 6 5 7 6 5 7 6 7 7 6 6 6 5 7 6 4 6 7 6 5 5 6 6 5 6 6 5 5 6 7 6 6 5 6 5 6 7 6 6 6 6 7 7 6 6 7 6 4 7 7 6 6 6 6 6 6 4 6 6 6 6 5 7 6 7 7 7 7 6 6 5 7 7 6 5 8 5 7 7 6 7 5 6 7 7 6 6 6 5 6 6 7 6 6 6 6 7 6 6 7 6 7 5 6 6 6 7 6 6 7 7 7 6 6 6 7 6 7 6 6 6 6 6 6 6 5 5 5 6 7 4 6 6 7 7 4 7 6 ...
result:
ok 38649 lines
Test #33:
score: 0
Accepted
time: 112ms
memory: 36208kb
input:
1 100000 100000 35 5040 60779 42161 16739 57998 22096 1724 89001 17255 8229 79131 75819 71396 84499 72613 66471 96971 46269 2107 68796 26450 78439 62431 96409 62776 72393 19038 68588 34146 54773 80450 88354 16867 25633 63136 8999 60566 22411 64686 14017 45544 6437 48726 9776 89297 37285 96406 10753 ...
output:
Case #1: 7 15 13 14 14 12 11 10 12 12 14 13 18 15 10 12 10 15 15 15 13 14 15 14 11 11 18 21 12 13 17 14 12 11 17 10 12 12 13 11 14 12 14 11 14 18 11 13 16 11 15 13 13 10 15 11 8 12 12 15 15 13 14 12 15 12 13 14 11 12 15 15 14 18 10 15 13 16 14 15 10 13 10 14 12 16 12 12 7 12 14 16 13 12 14 11 10 12...
result:
ok 100001 lines
Test #34:
score: 0
Accepted
time: 75ms
memory: 24704kb
input:
1 100000 100000 13 91822 56888 45602 672 89982 68686 80561 19879 11785 27692 47015 26692 3995 75072 79504 45264 54462 30962 78791 46616 90565 41411 58557 44678 73593 43557 17117 59817 76842 89259 41117 89709 34163 52361 58289 88919 60552 24747 50176 93407 56020 36307 67641 6908 88156 40838 20797 149...
output:
Case #1: 6 12 11 14 11 13 12 11 13 15 14 16 10 14 14 13 10 11 11 14 15 10 14 13 15 7 14 17 11 13 12 14 11 15 15 14 9 14 12 16 10 11 14 14 12 13 19 16 14 14 15 13 15 14 11 10 14 12 16 15 17 13 13 10 16 12 12 16 13 12 11 17 17 9 14 15 18 20 14 14 12 11 12 10 13 12 15 12 13 12 13 8 12 6 10 14 13 11 11...
result:
ok 100001 lines
Test #35:
score: 0
Accepted
time: 117ms
memory: 37340kb
input:
1 100000 100000 37 78716 23576 47712 34995 2298 35504 37401 72390 52789 40508 88324 587 87853 54761 21799 12701 63025 18904 68880 11695 30208 46606 49565 27638 19245 69856 460 60686 52618 91046 6215 54840 99 14424 71595 88374 24759 18188 27882 41672 50119 74941 40140 23554 36395 92403 79875 2716 879...
output:
Case #1: 9 13 17 17 10 20 15 17 19 16 18 14 14 18 16 19 19 20 16 19 16 18 12 14 16 15 13 14 17 18 16 14 15 17 15 14 12 15 16 16 14 16 13 17 16 17 17 14 18 16 16 16 19 13 14 15 18 16 14 17 16 13 16 15 17 15 17 18 18 19 18 15 14 13 16 19 15 16 17 16 20 19 12 16 14 17 15 16 8 19 18 15 17 16 15 13 15 1...
result:
ok 100001 lines
Test #36:
score: 0
Accepted
time: 117ms
memory: 34488kb
input:
1 100000 100000 34 23881 37037 7872 34230 1645 45449 52640 1892 2696 77720 63217 93959 86925 7246 23241 81088 84179 48622 82787 70922 78577 45270 77289 35042 57410 76792 37388 22477 75863 43141 1714 83177 64833 24771 14412 1324 37445 125 106 295 82166 46840 98627 20767 21305 75307 17084 52758 38700 ...
output:
Case #1: 30 43 45 36 18 35 27 42 46 23 39 47 33 36 52 37 24 35 36 50 43 41 46 36 26 44 53 59 56 45 49 33 34 49 47 50 56 39 42 41 40 40 39 43 34 52 52 46 38 22 51 36 44 54 32 34 47 56 35 41 33 37 36 56 31 44 37 30 45 25 35 43 47 41 40 46 51 39 55 49 59 41 44 42 45 43 35 49 43 43 43 32 35 40 52 54 37...
result:
ok 100001 lines
Test #37:
score: 0
Accepted
time: 2ms
memory: 7724kb
input:
10 19 97 1 2 9 17 18 4 16 9 14 4 9 17 11 9 12 5 7 18 5 15 17 7 10 13 17 9 15 8 12 5 6 19 4 18 8 10 18 11 10 15 1 5 15 17 9 8 4 16 2 11 5 4 15 1 2 7 5 2 10 6 11 1 3 12 1 6 13 7 1 13 9 2 3 8 18 17 2 10 17 15 11 1 16 5 3 7 19 9 6 1 6 7 11 18 15 14 10 12 3 14 7 6 8 4 14 2 4 17 19 5 1 14 16 10 11 12 6 9 ...
output:
Case #1: 1 3 2 1 3 1 1 4 1 6 5 3 1 1 3 4 1 1 0 Case #2: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 Case #3: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 Case #4: -1 -1 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 Case #5: -1 -1 1 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 0 Case #6: 1 2 2 1 2 ...
result:
ok 200 lines
Test #38:
score: 0
Accepted
time: 4ms
memory: 7684kb
input:
10 39 1464 2 29 27 2 37 22 38 20 29 25 37 26 18 16 24 9 10 35 30 38 20 13 31 25 1 20 39 5 31 39 22 14 17 26 30 29 12 34 38 22 4 5 36 30 1 38 4 36 1 12 14 4 16 20 26 23 5 12 32 21 19 16 21 17 23 30 6 14 29 33 11 10 28 3 26 20 11 33 25 13 30 20 22 39 29 36 35 17 2 8 7 28 17 13 38 6 12 29 17 12 39 31 2...
output:
Case #1: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 Case #2: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 Case #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 2 1 2 2 2 2 2 0 Case #4: 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 400 lines
Test #39:
score: 0
Accepted
time: 22ms
memory: 9184kb
input:
1 2239 53186 23 1589 980 880 410 1341 1545 1741 1688 522 270 959 144 233 375 1052 1880 1662 456 92 1771 236 227 971 1092 1452 881 294 896 16 896 204 225 321 808 40 901 614 1395 164 352 1798 887 576 453 29 924 873 1746 604 1190 95 1014 416 385 1256 472 674 447 1324 644 1952 276 807 421 1710 1263 1259...
output:
Case #1: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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 2240 lines
Test #40:
score: 0
Accepted
time: 7ms
memory: 13660kb
input:
3 26531 2030 28 17357 14683 15341 9540 5045 10672 22004 6482 17806 18588 25119 23975 21271 19323 16804 15979 20797 26013 11628 21966 13861 18304 24137 23948 2301 19701 23236 7665 20562 17963 9349 20033 15016 19077 25836 15351 23662 2879 17547 23963 14756 8920 24987 25132 8997 20340 25676 10829 3717 ...
output:
Case #1: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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 79596 lines
Test #41:
score: 0
Accepted
time: 53ms
memory: 17216kb
input:
1 75830 77290 5 71370 60747 75762 70755 57326 33657 62372 1309 8929 16255 71821 46801 17371 49465 41812 72519 30038 74315 62994 54315 31905 50736 66469 297 25005 12763 43364 2329 65492 24561 45953 3129 38668 46244 58991 35765 25954 32513 56907 47416 54715 23685 33537 23281 35948 31924 24447 6441 528...
output:
Case #1: -1 20 17 19 17 -1 19 16 14 23 12 12 18 -1 -1 13 14 -1 13 16 10 -1 18 13 16 20 18 16 16 13 -1 13 18 16 18 17 15 10 18 -1 15 13 15 15 16 -1 -1 15 17 18 21 15 18 22 16 19 -1 15 -1 17 -1 13 17 19 15 -1 -1 -1 18 20 -1 18 15 -1 16 14 16 18 18 18 19 -1 18 11 -1 15 14 18 -1 18 18 18 18 19 19 19 18...
result:
ok 75831 lines
Test #42:
score: 0
Accepted
time: 35ms
memory: 11584kb
input:
2 11501 38823 10 7374 9862 10423 4376 7376 6617 7719 9978 9118 6714 8817 10231 8100 7898 10596 9025 6510 10027 11436 10827 8403 9815 11130 8333 3996 10320 8384 10891 10907 8749 8930 10788 9645 9653 11193 9972 9993 6949 7769 6896 8722 10841 10303 3632 8821 10362 10625 8849 7726 5202 8052 9048 9935 42...
output:
Case #1: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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 23004 lines
Test #43:
score: 0
Accepted
time: 162ms
memory: 41620kb
input:
1 100000 100000 49 32606 91009 78630 91491 81006 32793 80135 59328 91827 55587 38482 47715 84141 36991 98638 66766 79117 11757 95688 65618 13421 97250 29144 29369 60464 54053 21896 85077 35552 49459 48833 80349 84611 69899 68944 75188 96401 75780 62401 57707 63566 70651 99646 46599 54360 94035 93699...
output:
Case #1: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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 100001 lines
Test #44:
score: 0
Accepted
time: 41ms
memory: 29920kb
input:
1 100000 100000 27 16051 59985 7111 4032 24103 23272 34546 24734 40755 18276 30204 23740 8146 49621 29555 12761 9476 4066 67548 25653 8376 13927 18939 51057 465 12955 37692 33422 77111 28335 11068 6184 74218 38841 23417 17194 39354 29977 16723 7534 53504 165 9459 17909 22323 11469 63960 59485 50443 ...
output:
Case #1: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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 100001 lines
Test #45:
score: 0
Accepted
time: 51ms
memory: 17656kb
input:
1 100000 100000 2 22599 26912 57980 61502 26003 40546 46465 9645 64363 19672 388 9979 51036 11175 31033 17342 50328 28933 43879 2016 5691 35177 7456 10286 34392 19152 18165 33815 14269 6523 32569 30034 51961 381 2030 14759 12759 6973 5286 599 8203 11627 10775 7525 43813 2683 47273 42622 27743 8832 3...
output:
Case #1: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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 100001 lines
Test #46:
score: 0
Accepted
time: 48ms
memory: 28708kb
input:
1 100000 100000 24 16779 78451 7649 3233 52603 27887 14856 82832 94359 3439 18693 7692 62310 19592 17537 41877 17172 6874 15420 19333 2026 35347 29742 82524 45128 30990 70683 601 49210 56730 12554 59326 2156 25040 36526 3983 37193 19691 15481 56849 71339 22757 34723 26509 40114 15585 13894 40456 993...
output:
Case #1: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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 100001 lines
Extra Test:
score: 0
Extra Test Passed