QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#448417 | #8759. 小班课 | C1942huangjiaxu | AC ✓ | 15ms | 6908kb | C++14 | 1.9kb | 2024-06-19 16:36:57 | 2024-06-19 16:36:59 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
mt19937 rnd(0x66ccff);
const int N=505;
int T,n,m,p[N][N],q[N],a[N][N],c[N],b[N],np[N],ans,r[N];
vector<int>e[N];
bool vis[N],dl[N];
bool dfs(int x){
for(auto v:e[x])if(!vis[v]){
vis[v]=true;
if(np[v]){
p[v][np[v]--]=x,q[x]=v;
return true;
}
for(int j=1;j<=b[v];++j)if(dfs(p[v][j])){
p[v][j]=x,q[x]=v;
return true;
}
}
return false;
}
void solve(){
scanf("%d%d",&n,&m);
for(int i=1;i<=m;++i){
scanf("%d",&b[i]);
np[i]=b[i];
for(int j=1;j<=b[i];++j)p[i][j]=0;
}
for(int i=1;i<=n;++i){
scanf("%d",&c[i]);
dl[i]=false,e[i].clear();
for(int j=1;j<=c[i];++j){
scanf("%d",&a[i][j]);
e[i].emplace_back(a[i][j]);
}
}
ans=0;
for(int i=1;i<=n;++i){
for(int j=1;j<=m;++j)vis[j]=false;
ans+=dfs(i);
}
printf("%d\n",ans);
for(int i=1;i<=n;++i){
vector<int>tmp;
int o=0;
for(int j=1;j<=n;++j)if(!dl[j]){
r[j]=0;
for(int k=1;k<=c[j];++k)if(b[a[j][k]]){
r[j]=a[j][k];
break;
}
if(!r[j]){
o=j;
break;
}
if(q[j])tmp.emplace_back(j);
}
if(o){
dl[o]=true;
printf("%d%c",o," \n"[i==n]);
continue;
}
while(1){
for(auto v:tmp)if(q[v]==r[v]||np[r[v]]){
o=v;
break;
}
if(o){
int v=r[o];
if(q[o]!=v)q[o]=v,p[v][np[v]--]=o;
for(int j=b[v];j;--j)if(p[v][j]==o){
for(int k=j;k<b[v];++k)p[v][k]=p[v][k+1];
break;
}
--b[v];
break;
}
for(auto v:tmp){
e[v].clear();
e[v].emplace_back(q[v]);
e[v].emplace_back(r[v]);
if(rnd()&1)swap(e[v][0],e[v][1]);
}
shuffle(tmp.begin(),tmp.end(),rnd);
for(int j=1;j<=m;++j){
for(int k=np[j];k<=b[j];++k)p[j][k]=0;
np[j]=b[j];
}
for(auto v:tmp){
for(int j=1;j<=m;++j)vis[j]=false;
assert(dfs(v));
}
}
dl[o]=true;
printf("%d%c",o," \n"[i==n]);
}
}
int main(){
scanf("%d",&T);
while(T--)solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3916kb
input:
3 5 5 1 1 1 1 1 4 1 3 2 4 1 5 4 3 4 2 1 2 3 5 1 1 5 3 1 2 2 2 1 2 2 1 2 2 1 3 2 1 3 2 1 3 5 5 1 1 1 1 1 2 1 2 2 5 4 2 3 2 2 4 3 2 5 1
output:
5 2 4 3 5 1 5 5 1 2 3 4 5 1 5 2 4 3
result:
ok Correct!
Test #2:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
250 2 1 2 1 1 1 1 1 1 1 0 2 2 1 1 1 1 2 2 1 2 2 0 2 2 1 2 1 2 1 1 1 1 1 1 2 1 0 0 1 2 1 0 0 2 1 2 1 1 0 1 2 1 0 0 2 1 2 1 1 1 1 1 1 1 1 1 1 2 1 0 1 2 2 2 2 0 1 1 1 2 1 1 1 0 1 1 1 0 1 2 0 1 1 1 2 2 1 1 1 1 2 1 2 2 2 1 1 2 2 1 2 2 1 1 2 0 1 1 2 2 1 2 1 1 0 2 2 2 0 1 1 1 2 1 1 1 1 1 2 1 2 0 1 1 1 1 1 ...
output:
2 1 2 0 1 2 1 2 2 1 2 1 1 0 1 0 1 1 2 1 0 1 2 1 2 1 1 0 1 1 2 1 0 1 0 1 0 1 2 1 2 2 2 1 1 1 1 2 1 1 2 1 1 1 1 1 2 1 1 1 1 2 0 1 2 1 1 1 1 0 1 1 1 2 1 2 0 1 0 1 1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 1 5 2 4 3 2 2 3 5 1 4 2 1 2 5 3 4 3 1 3 2 4 5 ...
result:
ok Correct!
Test #6:
score: 0
Accepted
time: 0ms
memory: 3952kb
input:
10 45 47 3 0 2 0 1 1 1 0 2 0 1 0 0 3 0 0 0 4 0 1 0 0 1 2 1 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 2 4 1 2 1 2 3 7 1 37 21 3 13 43 22 0 10 23 46 22 40 12 19 47 27 16 42 4 29 19 45 35 10 6 26 2 43 41 7 9 16 42 44 5 39 40 34 46 14 3 34 3 38 8 10 5 38 23 19 37 9 34 0 5 31 29 15 13 35 3 40 4 28 1 7 6 29 12 9 35 2...
output:
33 2 9 20 22 23 26 27 28 32 33 41 45 1 7 11 6 12 14 16 17 19 21 25 29 5 31 37 10 4 13 18 24 35 38 39 8 3 34 40 15 42 43 36 44 30 39 4 8 13 22 27 37 3 10 11 12 14 15 16 17 18 19 7 23 6 25 24 29 30 32 33 20 34 38 40 9 21 5 26 2 28 31 35 42 43 36 44 1 39 41 45 36 7 9 12 13 14 24 30 38 42 44 45 1 4 8 10...
result:
ok Correct!
Test #7:
score: 0
Accepted
time: 3ms
memory: 6132kb
input:
1 499 497 1 2 0 2 0 1 0 0 0 2 1 2 0 3 1 2 0 0 0 1 0 1 0 2 1 0 1 0 1 1 1 2 0 1 0 1 0 2 2 3 1 1 2 1 0 0 1 0 2 3 0 1 0 0 2 0 1 2 1 0 0 1 2 0 0 2 0 2 0 1 0 1 0 0 1 0 0 1 1 1 1 1 0 0 0 1 2 3 0 0 0 4 2 2 1 2 2 0 1 0 1 0 2 0 1 0 2 0 0 1 1 1 3 2 0 2 2 2 0 1 1 1 1 1 0 1 0 1 1 1 1 1 2 0 0 1 0 2 1 2 1 2 1 0 1 ...
output:
482 11 15 21 23 85 94 103 233 246 305 327 350 364 385 394 458 4 5 7 9 16 17 18 29 30 31 33 38 40 41 42 48 51 53 56 58 59 66 70 73 74 75 76 78 82 86 87 88 89 91 92 93 95 96 101 104 108 110 113 117 119 120 122 123 124 126 129 135 137 145 147 148 150 151 153 79 146 154 155 156 160 163 165 166 167 169 1...
result:
ok Correct!
Test #8:
score: 0
Accepted
time: 15ms
memory: 6908kb
input:
1 498 499 0 1 1 0 1 0 1 0 0 0 0 2 0 3 1 2 4 0 1 0 1 1 0 0 0 1 1 0 0 2 2 0 1 1 1 0 4 1 1 2 1 0 0 1 2 0 1 2 1 0 1 2 0 2 1 2 2 0 2 2 0 1 0 2 0 0 3 0 1 1 1 1 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 2 1 1 0 1 0 1 0 0 0 1 1 2 0 1 0 2 1 1 2 2 0 0 0 0 2 0 2 1 0 1 0 2 0 1 3 1 1 1 0 1 3 0 1 0 1 0 0 1 3 2 3 2 1 1 0 2 ...
output:
498 1 2 5 9 10 12 14 19 20 22 28 29 34 35 36 37 38 39 40 42 43 45 47 48 49 50 53 54 55 59 60 61 64 67 69 70 71 73 74 77 79 81 82 85 86 87 88 95 96 98 105 106 108 109 110 111 112 113 114 116 117 118 119 120 125 126 129 132 135 136 140 141 103 143 146 147 148 149 150 151 153 155 158 159 160 162 165 16...
result:
ok Correct!
Test #9:
score: 0
Accepted
time: 1ms
memory: 4528kb
input:
5 99 96 2 0 0 1 1 2 1 0 1 1 1 0 0 0 1 0 1 1 2 1 1 1 1 1 0 1 2 4 0 0 0 2 2 1 1 1 1 1 0 2 0 0 0 1 1 3 0 1 0 0 1 2 1 4 1 2 1 0 1 0 0 2 0 0 0 2 3 2 1 0 1 2 2 0 1 1 0 0 1 0 0 1 2 1 3 1 3 1 3 0 3 0 0 2 2 2 2 14 58 1 55 2 53 69 0 0 1 76 2 23 38 1 41 2 74 54 0 0 2 83 91 0 0 0 1 48 0 0 1 96 2 76 52 1 17 2 51...
output:
48 1 4 5 8 10 11 13 14 15 17 18 27 28 29 31 32 33 36 37 41 43 48 49 50 51 54 55 58 61 63 64 68 70 75 76 79 80 81 85 86 89 90 91 96 98 2 3 6 7 9 12 16 19 20 21 66 22 24 25 26 30 34 23 35 38 39 40 44 45 46 47 93 52 95 53 56 57 60 62 65 69 71 72 73 74 77 67 82 78 83 94 84 97 59 87 88 42 92 99 44 1 2 3 ...
result:
ok Correct!
Test #10:
score: 0
Accepted
time: 1ms
memory: 4220kb
input:
5 99 97 0 2 4 0 0 2 0 1 1 1 0 1 0 3 0 1 1 1 1 0 0 1 0 0 1 2 0 0 1 3 1 2 0 2 1 1 1 3 3 1 2 1 0 1 0 1 0 2 0 0 0 0 1 2 3 1 1 1 0 1 0 1 0 0 1 2 1 2 1 1 1 2 2 3 1 1 0 0 1 1 0 0 1 1 2 1 2 2 0 1 1 1 2 0 1 3 1 2 56 63 2 52 45 4 26 56 80 10 2 27 19 1 81 2 38 64 1 83 1 8 3 14 81 60 3 63 28 15 5 59 33 80 88 56...
output:
72 2 5 10 15 19 21 31 38 43 51 56 61 67 69 74 75 80 84 86 88 89 92 93 1 3 4 70 6 7 8 9 11 12 13 14 16 17 20 22 23 24 25 26 81 28 29 30 32 33 35 36 97 37 39 40 41 44 34 45 46 47 48 49 50 87 53 57 58 59 62 18 63 64 54 65 66 68 71 72 73 55 76 77 78 79 82 83 27 52 85 42 60 90 91 94 95 96 98 99 67 4 10 1...
result:
ok Correct!
Test #11:
score: 0
Accepted
time: 1ms
memory: 4236kb
input:
5 99 98 4 0 1 1 3 2 0 1 4 0 1 1 2 2 1 2 0 0 1 2 1 2 0 1 1 1 2 0 2 0 0 3 0 2 0 0 1 1 1 0 1 1 1 2 0 1 1 0 1 1 1 0 0 1 0 0 2 1 2 3 3 0 0 0 0 0 1 2 1 1 0 3 0 0 0 1 2 0 0 0 0 1 0 2 2 1 2 1 0 1 0 0 1 1 2 3 3 0 5 72 78 90 7 60 6 69 37 10 41 4 59 10 61 85 79 5 7 58 3 55 1 50 6 59 24 30 26 77 21 2 29 21 10 7...
output:
85 7 9 13 17 18 22 36 45 48 52 56 61 88 92 1 3 4 5 6 8 11 12 15 19 20 21 23 24 27 29 30 32 35 37 38 40 41 42 47 49 51 53 55 46 16 54 57 58 59 60 14 62 63 64 65 66 67 25 34 68 69 70 71 44 72 73 74 76 77 79 33 80 82 83 10 26 39 50 78 84 85 81 86 89 87 90 91 93 94 96 97 75 2 95 98 28 43 31 99 87 15 18 ...
result:
ok Correct!
Test #12:
score: 0
Accepted
time: 1ms
memory: 4312kb
input:
5 97 100 1 1 1 0 0 1 0 1 1 2 0 1 2 0 1 0 2 3 0 1 0 1 0 1 0 0 1 0 1 2 0 3 2 2 1 0 1 1 2 3 3 1 0 2 1 1 1 2 2 2 0 2 0 3 1 2 2 2 0 1 0 1 1 0 2 0 0 0 0 3 1 0 0 1 0 1 1 0 0 1 1 2 1 2 0 0 1 2 0 1 1 0 2 0 0 1 0 0 2 2 48 80 1 66 89 71 73 40 2 50 99 68 91 31 76 25 67 94 37 6 88 86 28 22 43 62 21 16 17 39 70 1...
output:
94 46 68 95 1 2 4 5 6 8 9 10 12 14 16 3 17 18 19 20 22 23 25 26 27 29 30 31 33 36 38 40 42 43 44 49 53 50 56 57 59 62 63 64 66 69 11 70 75 76 13 60 72 35 37 48 78 79 7 21 24 28 32 52 61 80 83 84 45 51 54 58 65 86 87 88 89 39 41 90 92 94 71 67 73 15 34 55 74 81 82 77 85 93 96 47 91 97 94 78 93 6 7 13...
result:
ok Correct!
Test #13:
score: 0
Accepted
time: 1ms
memory: 4228kb
input:
5 96 96 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 72 44 0 0 1 75 0 2 48 35 1 29 1 55 2 75 32 1 95 0 2 87 85 1 69 1 6 2 48 6 1 77 1 67 0 0 1 75 2 59 ...
output:
59 2 3 5 11 18 19 26 28 30 33 37 38 40 42 43 50 52 53 57 63 66 72 76 77 84 92 93 94 95 4 20 7 64 8 9 10 35 12 13 14 58 15 6 16 17 21 22 96 23 24 25 29 31 32 34 36 39 41 45 47 48 27 49 51 54 82 44 55 56 59 46 60 61 65 67 68 69 83 70 71 62 1 73 74 75 78 87 79 80 81 85 86 88 89 90 91 54 1 2 6 10 12 15 ...
result:
ok Correct!
Test #14:
score: 0
Accepted
time: 2ms
memory: 5700kb
input:
1 499 497 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
287 4 5 9 11 12 14 16 17 18 19 22 30 33 38 42 45 52 54 62 63 66 70 71 72 74 78 86 88 90 94 95 98 103 104 105 110 117 121 124 127 128 129 130 133 138 139 142 149 151 153 157 158 165 168 180 181 182 184 188 189 193 194 195 196 200 202 203 205 206 212 213 217 219 221 224 230 239 240 241 242 245 247 248...
result:
ok Correct!
Test #15:
score: 0
Accepted
time: 1ms
memory: 4324kb
input:
10 50 49 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 43 0 0 2 25 28 0 0 2 28 14 0 2 8 38 1 1 0 1 6 1 41 0 2 40 47 2 8 34 2 26 41 2 31 28 1 5 0 2 33 45 0 2 14 43 0 2 39 34 1 32 1 6 1 15 1 17 0 0 2 9 6 2 37 1 0 2 13 20 0 2 4 41 2 31 5 0 2 44 14 1...
output:
30 2 3 5 6 8 11 14 20 22 24 30 31 34 36 39 42 1 4 7 10 12 27 13 15 16 9 17 18 19 38 23 25 26 43 28 45 29 32 33 35 37 40 41 44 46 47 48 49 21 50 27 1 2 4 7 8 11 13 18 22 23 26 28 30 31 32 36 37 42 46 47 3 5 6 9 10 15 12 17 19 20 39 21 48 24 14 25 27 29 34 16 35 38 33 40 49 41 43 44 45 50 25 5 6 11 13...
result:
ok Correct!
Test #16:
score: 0
Accepted
time: 1ms
memory: 4092kb
input:
10 50 49 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 32 0 0 2 47 41 1 10 3 33 18 13 1 43 1 49 1 39 0 0 3 16 27 31 0 0 2 30 25 3 23 16 37 3 18 1 46 2 8 9 3 32 33 10 3 24 14 31 3 31 11 2 2 8 36 1 44 1 9 0 2 39 27 1 14 1 6 3 47 12 10 1 14 1 10 0 1...
output:
32 2 3 10 11 13 14 25 32 37 41 43 50 1 5 31 7 8 9 12 15 16 18 19 20 22 23 24 38 26 39 27 30 28 29 4 33 34 40 35 36 42 21 44 45 46 47 6 17 48 49 31 7 8 9 10 12 13 19 20 22 24 30 35 37 44 45 50 1 5 6 11 14 47 15 40 16 17 18 33 21 23 4 25 26 27 28 29 31 32 34 36 2 3 39 41 42 38 43 46 48 49 35 5 12 14 1...
result:
ok Correct!
Test #17:
score: 0
Accepted
time: 2ms
memory: 6024kb
input:
1 495 495 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
344 3 5 7 11 13 14 15 17 21 26 27 31 33 34 35 46 53 56 57 58 66 69 72 73 75 76 83 85 89 93 98 99 100 101 105 112 117 118 119 128 130 131 138 140 142 143 151 152 166 170 176 186 200 201 202 206 213 214 215 226 238 239 244 248 257 269 273 281 282 284 286 290 292 293 295 297 301 302 303 308 310 311 312...
result:
ok Correct!
Test #18:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
250 1 2 1 0 2 1 2 2 2 0 2 1 1 1 1 2 2 1 1 2 1 2 2 1 2 1 1 1 0 2 2 0 2 2 1 2 0 2 1 2 1 1 0 2 2 0 2 1 1 2 1 2 2 1 2 0 0 1 2 0 1 2 1 2 1 1 1 1 1 2 1 2 0 1 1 2 2 1 1 2 1 2 1 1 1 1 1 1 1 2 1 2 0 1 1 1 2 0 1 2 1 2 1 2 0 1 0 1 2 0 1 1 1 2 2 1 1 1 1 2 1 2 2 1 2 1 1 1 1 1 2 1 0 2 1 2 1 2 0 1 2 1 2 1 2 1 0 2 ...
output:
1 1 0 1 2 2 2 1 0 1 1 2 1 1 2 1 1 1 2 0 1 2 1 1 1 1 1 1 2 2 2 1 1 1 1 1 2 1 1 0 1 0 1 2 1 2 2 1 2 1 1 1 1 1 1 2 1 2 0 1 2 2 1 2 1 1 1 2 1 0 1 1 1 1 1 1 2 1 2 1 2 1 1 2 1 1 1 1 2 0 1 1 1 2 1 2 1 1 1 1 2 1 1 2 0 1 2 0 1 0 1 2 1 1 1 1 2 0 1 2 1 2 1 1 1 0 1 0 1 2 1 2 1 1 0 1 2 1 1 2 1 2 0 1 1 1 1 1 0 1 ...
result:
ok Correct!
Test #19:
score: 0
Accepted
time: 0ms
memory: 3920kb
input:
166 3 3 1 1 1 1 1 0 1 1 3 3 1 1 1 1 1 2 1 2 0 3 3 1 2 0 1 1 1 1 0 3 3 1 0 2 0 2 1 2 0 3 3 0 2 1 1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 3 2 4 0 1 2 3 4 3 3 1 4 2 2 1 2 3 4 2 2 3 4 1 2 1 4 3 2 0 1 2 3 4 2 1 4 3 2 2 3 4 1 2 2 1 2 3 4 2 1 2 4 3 2 1 3 4 2 0 1 2 3 4 2 1 2 3 4 ...
result:
ok Correct!
Test #21:
score: 0
Accepted
time: 1ms
memory: 4132kb
input:
100 5 5 0 0 1 1 3 3 1 2 3 3 1 2 3 2 1 2 3 1 2 3 1 1 5 5 1 2 1 0 1 0 2 1 2 0 3 1 2 3 0 5 5 0 0 1 2 2 3 1 2 3 3 1 2 3 3 1 2 3 0 3 2 3 4 5 5 0 2 1 2 0 1 1 2 1 2 3 1 2 3 1 1 2 1 2 5 5 0 0 0 0 5 0 0 0 0 3 1 2 3 5 5 1 0 0 2 2 1 1 3 1 2 3 2 1 2 3 1 2 3 3 1 2 3 5 5 0 0 1 2 2 3 1 2 3 0 0 2 1 2 1 1 5 5 0 2 0 ...
output:
1 3 5 1 2 4 2 1 3 5 4 2 2 4 1 2 3 5 3 1 4 2 5 3 0 1 2 3 4 5 1 1 2 3 4 5 1 2 3 4 5 1 2 1 2 3 4 5 0 1 2 3 4 5 4 1 2 4 3 5 2 2 5 1 3 4 0 1 2 3 4 5 3 2 4 5 1 3 2 2 3 4 5 1 3 2 5 3 4 1 1 2 3 1 4 5 2 1 5 3 4 2 1 2 3 5 1 4 2 2 3 5 1 4 3 1 3 4 2 5 3 1 5 4 3 2 0 1 2 3 4 5 1 1 3 4 5 2 0 1 2 3 4 5 0 1 2 3 4 5 ...
result:
ok Correct!
Test #22:
score: 0
Accepted
time: 1ms
memory: 4004kb
input:
10 49 49 0 0 0 0 0 1 0 1 0 0 1 0 0 1 1 0 0 1 2 0 2 2 1 1 0 0 2 3 1 2 1 1 1 2 2 0 1 0 1 0 2 2 0 0 4 1 3 3 3 5 3 10 12 16 18 5 2 16 36 21 39 9 19 23 5 31 32 12 15 34 40 0 5 5 19 21 24 30 3 6 8 16 6 15 17 26 2 14 7 1 3 2 14 15 3 16 21 23 6 3 4 17 19 21 22 1 7 7 2 11 28 10 13 31 6 0 6 13 33 43 47 14 1 4...
output:
29 4 8 12 14 19 21 24 27 31 37 43 44 48 1 2 7 23 25 9 11 16 29 35 47 6 40 26 45 10 49 28 17 18 30 34 38 13 41 32 39 5 20 42 3 33 36 15 22 46 22 1 3 6 8 10 11 15 16 18 20 26 30 31 34 35 37 39 40 43 44 49 4 2 5 13 19 33 7 9 12 14 17 21 24 27 22 23 28 29 25 36 41 42 32 38 47 45 46 48 28 1 5 8 9 14 18 2...
result:
ok Correct!
Test #23:
score: 0
Accepted
time: 0ms
memory: 6192kb
input:
1 498 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 1 0 2 1 0 1 0 0 2 0 1 0 0 1 1 0 0 0 0 0 2 0 0 1 0 1 0 0 0 0 0 2 1 2 0 1 0 0 1 1 0 1 ...
output:
464 59 64 76 87 88 104 142 155 168 170 174 181 210 220 261 277 289 295 300 328 380 387 397 424 435 443 451 467 470 472 489 495 3 6 8 10 12 16 17 325 21 26 27 33 36 37 40 42 45 46 48 52 54 55 57 1 58 60 61 65 66 73 50 74 78 80 82 91 93 94 9 102 103 105 68 106 115 124 128 135 138 483 112 146 149 162 1...
result:
ok Correct!
Test #24:
score: 0
Accepted
time: 10ms
memory: 6460kb
input:
1 497 496 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 1 0 1 0 1 0 2 1 0 0 0 0 0 0 0 1 1 0 1 0 1 2 1 2 0 1 0 0 1 2 0 1 1 1 0 0 0 0 2 1 1 1 0 0 1 ...
output:
496 24 1 15 16 20 28 33 40 41 12 48 39 54 62 5 67 75 77 93 61 95 96 97 102 104 109 110 116 119 120 124 131 19 34 137 138 30 142 143 147 149 150 155 158 35 166 167 174 179 46 190 195 197 198 199 81 208 216 221 231 241 100 63 214 10 182 245 210 248 252 254 256 260 71 164 203 262 269 272 273 277 278 27...
result:
ok Correct!
Test #25:
score: 0
Accepted
time: 1ms
memory: 4260kb
input:
5 100 100 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1 2 0 1 0 0 1 1 1 1 0 2 1 0 0 1 2 1 0 1 1 1 1 0 1 1 2 5 1 0 1 2 0 2 0 3 1 1 1 2 3 2 1 1 1 2 4 2 1 4 1 2 1 0 3 3 1 3 0 0 3 1 0 0 0 3 4 2 1 35 0 1 8 1 35 0 0 1 10 2 15 19 2 1 3 2 6 61 0 0 0 0 2 14 20 2 4 80 0 0 0 1 6 0 1 13 1 4 ...
output:
19 1 2 4 5 6 8 9 11 12 13 14 15 17 18 19 20 21 23 24 25 26 28 29 30 31 33 34 35 36 38 40 41 42 44 45 46 49 50 51 52 53 55 56 58 60 61 62 63 64 65 67 68 69 71 72 74 75 77 78 80 81 85 86 87 88 89 90 91 93 94 95 96 97 99 100 3 82 84 7 10 16 22 70 83 27 32 92 37 39 43 47 76 48 54 57 59 66 73 79 98 26 2 ...
result:
ok Correct!
Test #26:
score: 0
Accepted
time: 1ms
memory: 4212kb
input:
5 95 99 0 0 1 0 0 0 0 0 1 1 0 0 0 2 1 0 0 0 1 0 1 0 0 0 1 2 0 0 1 1 2 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 1 1 1 2 2 0 0 0 1 0 1 1 1 4 3 0 3 1 2 1 0 1 0 1 5 0 1 1 0 3 0 3 1 2 2 4 0 0 0 1 1 1 2 3 1 0 2 4 0 1 1 4 3 0 1 5 3 31 50 70 1 21 5 14 26 31 2 6 5 7 41 19 45 30 3 1 6 40 0 2 16 19 4 5 6 9 25 0 0 5 17 47...
output:
41 1 2 8 11 12 14 20 23 24 25 26 31 32 34 37 40 48 50 52 53 60 64 68 74 76 77 80 86 91 94 95 4 39 78 5 7 49 55 9 17 15 18 66 16 21 54 22 83 28 29 89 30 33 46 67 71 81 35 56 58 88 36 38 10 59 19 27 41 61 43 44 6 93 42 63 3 45 47 51 57 65 69 70 75 13 72 92 73 79 82 84 85 90 62 87 37 2 3 4 7 11 15 17 1...
result:
ok Correct!
Test #27:
score: 0
Accepted
time: 0ms
memory: 4220kb
input:
5 97 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 1 0 0 1 1 2 0 0 1 2 1 0 0 1 2 2 1 0 2 0 1 0 0 3 0 2 3 0 2 1 1 1 1 0 1 1 2 4 1 0 2 1 0 1 2 1 2 2 2 1 2 5 2 0 1 0 3 1 3 1 0 1 2 0 0 2 4 2 2 1 2 1 3 0 0 5 14 16 33 41 9 7 12 28 16 32 45 46 71 10 15 63 65 17 66 18 81 45 8 68 6 8 35 12 54 21 63 0 0 0 ...
output:
67 1 6 7 8 9 11 15 17 28 30 32 33 35 37 39 44 61 68 74 76 79 88 90 2 5 12 82 14 16 18 46 52 80 22 24 25 26 38 40 66 13 42 43 45 49 54 48 57 36 51 21 29 59 63 27 65 70 73 58 60 75 78 19 56 83 50 85 94 41 91 55 69 31 53 23 86 64 72 3 77 47 20 81 87 89 92 84 93 34 67 10 4 62 71 95 96 97 62 2 3 6 7 9 17...
result:
ok Correct!
Test #28:
score: 0
Accepted
time: 2ms
memory: 4240kb
input:
5 95 95 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 0 0 0 1 1 0 1 0 1 1 1 0 0 2 1 0 0 1 1 0 0 1 0 1 0 0 3 0 2 1 1 5 0 0 0 4 3 0 2 1 0 3 2 2 1 2 1 6 1 3 4 2 1 2 2 3 0 2 0 2 1 1 2 2 1 0 2 1 0 0 1 2 3 16 2 9 23 36 52 58 31 65 66 71 72 17 75 24 44 27 28 4 2 32 38 45 21 52 61 94 55 46 79 92 1 11 65 73 95...
output:
89 5 8 12 24 62 90 1 9 13 25 30 32 35 38 41 52 3 7 54 10 15 20 22 61 53 64 68 71 31 72 78 82 33 84 92 26 29 42 46 73 75 88 93 59 85 2 34 45 50 95 56 65 77 94 6 4 16 18 23 39 49 51 55 57 60 63 70 74 44 17 19 27 66 80 81 14 11 40 43 47 48 76 79 83 28 58 69 21 37 86 87 89 36 67 91 89 18 25 33 35 88 90 ...
result:
ok Correct!
Test #29:
score: 0
Accepted
time: 1ms
memory: 5504kb
input:
1 498 500 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 2 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 1 1 2 0 0 1 0 0 0 0 0 1 0 0 2 0 1 1 1 0 0 1 0 2 0 0 1 1 0 0 2 0 0 0 0 0 3 1 0 2 0 1 3 0 0 0 ...
output:
108 2 3 4 6 7 8 10 11 19 20 21 22 23 24 25 26 27 28 30 31 32 36 38 40 41 44 45 47 50 53 55 56 59 61 62 63 64 65 66 68 69 70 71 72 74 76 77 78 79 80 84 85 87 88 89 90 91 92 97 100 102 106 107 108 109 111 113 114 115 117 118 119 121 122 124 126 129 130 131 132 134 135 136 140 141 142 143 145 146 147 1...
result:
ok Correct!
Test #30:
score: 0
Accepted
time: 0ms
memory: 5904kb
input:
1 500 498 2 0 0 1 1 1 0 0 0 0 1 1 2 2 2 0 1 0 0 0 1 1 1 0 1 1 2 2 2 1 1 0 4 3 1 1 1 1 0 3 0 3 3 1 2 1 0 2 3 2 0 2 0 0 0 1 1 1 0 2 4 1 0 1 1 1 1 3 1 0 0 1 1 2 2 4 1 1 1 0 0 2 2 1 2 1 1 1 0 0 2 0 0 1 0 0 1 1 1 1 0 1 0 0 1 2 1 1 1 2 2 4 2 0 0 0 0 1 1 0 1 4 1 3 0 2 0 3 0 1 1 1 0 4 0 1 1 3 2 0 0 1 0 1 1 ...
output:
258 35 72 137 164 167 181 186 229 236 314 322 338 386 419 452 495 1 3 5 6 7 9 12 17 18 20 2 21 26 28 29 30 31 33 36 8 37 39 41 44 46 47 50 51 301 52 58 60 61 66 68 70 73 25 75 76 78 80 82 84 32 91 93 94 98 99 104 83 105 109 112 339 77 114 115 120 126 288 10 130 131 132 134 23 42 136 138 141 143 150 ...
result:
ok Correct!
Test #31:
score: 0
Accepted
time: 15ms
memory: 6340kb
input:
1 496 498 0 0 0 0 2 0 0 1 0 1 1 0 2 3 1 1 2 0 3 2 2 0 2 1 2 0 1 1 1 0 1 2 0 0 0 0 5 1 1 0 2 1 0 0 1 0 0 2 0 3 0 0 3 1 0 3 0 1 1 2 1 2 0 2 0 2 1 0 3 0 1 0 1 1 2 0 1 0 0 1 2 1 2 0 1 0 1 1 1 0 3 3 3 2 0 1 2 1 1 3 1 1 0 0 3 0 1 0 0 0 0 1 3 1 0 1 1 2 1 0 1 2 0 2 0 1 1 1 2 2 0 0 1 2 1 1 1 2 1 3 1 1 1 0 0 ...
output:
248 1 2 3 4 8 9 11 12 14 17 18 20 23 24 26 28 30 31 32 34 38 39 40 42 43 44 46 47 48 49 50 51 53 55 54 57 58 61 63 65 69 71 72 77 78 79 80 82 52 33 83 16 85 89 91 94 95 97 101 102 103 105 106 111 112 113 119 120 114 27 121 127 129 130 131 136 142 145 146 147 148 67 100 150 151 152 155 99 156 158 140...
result:
ok Correct!
Test #32:
score: 0
Accepted
time: 1ms
memory: 4100kb
input:
10 49 50 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 0 1 4 0 1 7 2 8 7 2 9 8 0 1 10 1 12 2 13 12 0 0 1 16 2 16 17 0 1 19 0 1 20 1 21 1 23 2 24 23 2 25 24 1 26 1 27 1 27 1 28 0 2 31 30 1 32 0 1 33 1 34 2 35 36 1 37 2 38 37 1 38 1 40 2 41 4...
output:
35 2 3 5 9 13 14 17 19 29 32 47 1 4 6 7 8 10 11 12 15 16 18 20 21 22 23 24 25 26 27 28 30 31 33 34 35 36 37 38 39 40 41 42 43 44 45 46 48 49 31 3 4 5 6 8 10 22 25 26 33 44 48 1 2 49 7 9 11 12 13 14 15 16 17 18 19 20 21 23 24 27 28 29 30 31 32 34 35 36 37 38 39 40 41 42 43 45 46 47 30 3 5 17 23 30 33...
result:
ok Correct!
Test #33:
score: 0
Accepted
time: 0ms
memory: 4308kb
input:
5 99 99 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 0 0 2 5 4 1 5 1 7 0 1 9 1 10 0 2 12 11 1 12 1 14 1 14 2 15 16 1 17 0 1 19 1 19 1 21 2 21 2...
output:
60 2 3 7 10 17 28 29 30 35 37 39 46 47 48 49 52 59 61 63 64 65 72 74 78 79 80 82 83 89 90 92 98 1 5 4 6 8 9 12 11 13 14 15 16 18 19 20 21 22 23 24 25 26 27 33 32 31 34 36 38 40 41 42 43 44 45 50 51 53 54 55 56 57 58 60 62 67 66 68 69 70 71 73 75 76 77 81 84 85 86 87 88 91 93 94 95 96 97 99 63 5 16 2...
result:
ok Correct!
Test #34:
score: 0
Accepted
time: 0ms
memory: 5736kb
input:
1 496 500 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
325 8 10 19 20 21 22 25 33 34 39 46 48 51 52 59 61 72 79 80 81 83 86 89 100 110 123 128 136 138 141 144 147 152 157 161 162 163 164 169 174 177 184 185 187 196 211 216 221 228 229 234 236 238 239 244 248 249 252 254 257 258 259 260 262 263 266 271 272 275 277 278 279 281 284 290 301 304 306 311 314 ...
result:
ok Correct!
Test #35:
score: 0
Accepted
time: 1ms
memory: 4040kb
input:
10 46 47 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 3 4 1 5 2 5 6 2 6 5 3 8 6 7 0 1 8 1 10 0 2 11 13 2 14 13 2 14 13 3 15 14 16 2 16 15 1 18 1 18 0 1 20 1 21 1 21 0 2 23 24 1 26 2 27 26 1 27 1 29 1 29 1 31 1 30 1 32 1 32 1 33 2 35 36 2 35 37 1...
output:
34 7 10 18 22 1 46 2 3 4 5 8 6 9 11 13 12 14 15 16 17 19 20 21 23 24 25 26 27 28 29 30 31 32 33 34 35 36 39 40 38 37 41 42 43 44 45 36 11 19 20 23 26 32 39 43 48 1 47 2 3 4 6 5 7 8 9 13 12 10 14 15 16 17 18 21 22 24 25 27 28 29 31 30 33 34 35 36 37 38 41 42 40 44 45 46 39 28 37 43 44 1 2 48 5 3 47 4...
result:
ok Correct!
Test #36:
score: 0
Accepted
time: 1ms
memory: 4220kb
input:
5 99 99 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 3 2 2 4 3 2 4 3 0 2 6 7 1 6 3 8 7 9 2 10 9 1 11 3 12 11 10 3 13 12 11 1 12 2 13 14 0 1 15 ...
output:
75 4 14 17 21 25 26 28 29 31 35 49 51 57 61 69 78 94 3 2 6 5 7 9 11 12 10 8 13 15 16 18 20 19 22 23 24 27 30 32 33 34 37 36 38 39 40 41 42 43 44 45 46 47 48 50 52 54 53 55 56 58 59 60 62 63 64 65 67 66 68 70 71 72 73 74 75 77 76 79 80 81 82 84 83 86 85 87 88 91 89 90 93 92 96 97 95 98 99 1 75 6 22 2...
result:
ok Correct!
Test #37:
score: 0
Accepted
time: 1ms
memory: 5764kb
input:
1 495 497 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
383 15 19 24 35 44 56 116 142 151 161 162 164 176 213 230 235 238 245 249 257 266 277 281 288 291 295 296 302 303 305 316 324 325 328 331 334 338 341 355 370 372 382 391 399 401 402 413 415 421 429 431 437 445 449 457 465 467 469 471 473 476 487 489 492 495 1 2 4 3 5 6 7 8 10 9 11 12 13 14 16 17 18 ...
result:
ok Correct!
Test #38:
score: 0
Accepted
time: 1ms
memory: 4024kb
input:
10 45 49 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 5 2 0 2 6 5 3 4 5 8 3 9 6 8 3 7 8 10 1 8 3 8 11 10 2 12 10 3 13 12 10 3 14 15 12 3 14 13 12 3 15 17 13 2 15 18 3 19 17 18 4 16 17 19 20 3 18 21 20 1 18 2 19 21 3 21 20 23 3 23 21 25 1 22 3 ...
output:
43 2 1 3 4 5 6 7 8 11 12 10 9 14 13 15 16 18 19 17 20 21 22 23 24 25 26 27 30 28 29 31 33 34 32 35 37 36 42 40 39 38 41 43 44 45 42 31 1 3 4 2 5 9 7 8 6 10 11 12 14 13 16 18 19 15 17 20 21 22 23 24 25 27 29 28 26 30 32 33 34 35 36 38 37 39 40 41 43 44 42 45 44 1 2 4 5 3 7 8 6 9 11 12 15 14 10 13 17 ...
result:
ok Correct!
Test #39:
score: 0
Accepted
time: 1ms
memory: 4288kb
input:
5 95 98 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 5 1 3 1 6 3 5 4 7 2 7 8 1 7 3 7 10 6 3 9 11 8 4 10 8 9 11 3 9 10 12 1 12 3 12 14 15 1 16 4 14 ...
output:
90 57 1 2 3 5 4 6 8 7 9 10 12 15 16 17 14 11 13 19 20 21 18 22 23 24 25 26 27 28 29 30 31 32 33 35 36 34 37 38 40 39 42 41 43 47 45 44 46 50 48 51 49 52 53 54 56 55 58 60 63 61 59 62 64 67 66 65 68 70 71 69 72 74 73 75 77 76 78 79 80 81 82 83 87 85 84 86 89 88 90 91 92 93 94 95 90 96 1 3 97 5 2 9 6 ...
result:
ok Correct!
Test #40:
score: 0
Accepted
time: 0ms
memory: 5808kb
input:
1 498 496 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
462 11 40 122 190 210 235 242 250 260 268 289 339 355 371 400 416 474 6 3 5 2 4 497 10 7 8 9 12 18 20 16 15 13 14 17 19 21 22 23 25 26 24 27 28 29 30 31 32 33 34 35 36 37 38 39 41 42 45 44 43 46 47 48 52 49 50 53 56 54 51 57 55 58 59 63 64 60 61 62 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 79 81 ...
result:
ok Correct!
Test #41:
score: 0
Accepted
time: 1ms
memory: 4092kb
input:
10 49 47 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 7 3 1 7 4 9 8 10 6 11 2 6 3 4 5 3 3 12 10 5 5 9 6 12 7 5 13 7 10 9 11 3 10 6 12 6 12 16 7 8 10 9 7 11 9 16 12 17 10 15 5 15 14 11 13 9 3 12 18 16 5 13 20 17 15 19 4 15 19 17 12 7 13 15 22 18 19 17 ...
output:
47 1 2 3 4 5 6 8 10 11 14 17 18 16 15 9 12 13 20 19 21 22 23 24 25 28 31 27 32 34 37 39 40 43 36 30 29 26 33 35 38 41 44 49 42 46 47 45 7 48 48 2 3 10 11 12 6 13 15 16 20 21 24 27 23 19 25 29 30 32 26 22 18 14 8 4 5 7 1 17 9 33 31 28 34 37 39 40 42 46 44 47 48 41 45 38 36 35 43 47 3 4 7 8 9 13 14 19...
result:
ok Correct!
Test #42:
score: 0
Accepted
time: 1ms
memory: 4516kb
input:
5 99 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 9 7 5 2 9 8 11 7 6 5 8 4 9 3 11 6 9 8 13 10 12 4 6 5 6 12 14 9 11 2 10 14 8 12 15 8 9 14 ...
output:
99 2 3 4 1 5 6 7 8 9 11 13 14 15 16 17 12 10 18 19 22 21 20 23 25 26 29 30 31 33 24 28 35 32 27 37 36 34 39 40 41 42 38 44 45 46 47 51 52 53 55 57 56 50 48 49 43 54 58 61 62 63 65 59 60 64 66 67 68 69 70 71 72 75 74 77 78 73 76 80 82 86 84 85 87 81 79 83 90 93 89 94 88 96 91 92 95 97 98 99 95 10 13 ...
result:
ok Correct!
Test #43:
score: 0
Accepted
time: 0ms
memory: 5780kb
input:
1 498 499 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
497 1 4 5 7 6 8 11 12 13 14 15 10 3 2 17 18 19 20 21 22 23 26 27 30 31 33 34 35 36 28 29 25 24 16 9 41 39 38 32 42 37 40 44 45 46 47 43 48 51 49 52 53 54 50 56 57 55 58 63 65 59 60 62 64 68 73 70 71 74 76 75 66 61 69 67 77 72 78 80 81 79 82 83 84 85 87 88 89 86 91 92 96 93 97 94 98 100 102 103 111 1...
result:
ok Correct!