QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#100373 | #6339. Cookies | chenshi | 13 | 6ms | 6416kb | C++ | 1.6kb | 2023-04-25 18:40:17 | 2023-04-25 18:40:18 |
Judging History
answer
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cassert>
using namespace std;
const int o=15010;
int n,m,a[o],a_[o],b[o],p[o],s,fa[o*2],f[o][o],cnt[o],st[o],tp,q[o];vector<int> vec[o];
inline bool cmp(int A,int B){return a[A]>a[B];}
inline bool Cmp(int A,int B){return st[A]>st[B];}
int fr(int x){return fa[x]==x?x:fa[x]=fr(fa[x]);}
int main(){
scanf("%d",&n);
for(int i=1;i<=n;++i) scanf("%d",&a[i]),p[i]=i,s+=a[i];
sort(p+1,p+n+1,cmp);
scanf("%d",&m);
for(int i=1;i<=m;++i) scanf("%d",&b[i]);
for(int i=m+1;i;--i) for(int j=0;j<=s;++j) f[i][j]=o;
for(int i=n;i;--i) a_[i]=a_[i+1]+a[p[i]];
for(int i=s+1;i<=s*2;++i) fa[i]=i;
f[m+1][0]=0;
for(int i=m;i;--i){
for(int j=0;j<=s;++j) fa[j]=j;
for(int j=s,lim;j+1;--j) if(f[i+1][j]<o){
lim=(s-j)/b[i];
for(int k=b[i];k>b[i-1];--k) lim=min(lim,(a_[k]-j)/(b[i]-k+1));
if(lim<f[i+1][j]) continue;
lim=j+(b[i]-b[i-1])*lim;
for(int t=j+(b[i]-b[i-1])*f[i+1][j];(t=fr(t))<=lim;)
f[i][t]=(t-j)/(b[i]-b[i-1]),fa[t]=t+b[i]-b[i-1],assert(fa[t+b[i]-b[i-1]]==t+b[i]-b[i-1]||fr(t)>lim);
}
}
if(f[1][s]==o){printf("-1");return 0;}
printf("%d\n",f[1][s]);
for(int i=1,j=s;i<=m;++i) cnt[i]=f[i][j],j-=(b[i]-b[i-1])*f[i][j];
for(int i=1;i<=m;++i) for(int j=cnt[i]-cnt[i+1];j--;) st[++tp]=b[i];
for(int i=1;i<=tp;++i) q[i]=i;
for(int i=1;i<=n;++i){
nth_element(q+1,q+a[p[i]],q+tp+1,Cmp);
for(int j=1;j<=a[p[i]];++j) vec[q[j]].push_back(p[i]),--st[q[j]];
}
for(int i=1;i<=tp;++i,putchar('\n')){
printf("%llu ",vec[i].size());
for(int j=vec[i].size();j--;) printf("%d ",vec[i][j]);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 6
Accepted
Test #1:
score: 6
Accepted
time: 2ms
memory: 3436kb
input:
1 1 1 1
output:
1 1 1
result:
ok good!
Test #2:
score: 0
Accepted
time: 0ms
memory: 3300kb
input:
2 1 1 1 1
output:
2 1 1 1 2
result:
ok good!
Test #3:
score: 0
Accepted
time: 1ms
memory: 3432kb
input:
2 1 1 1 2
output:
1 2 2 1
result:
ok good!
Test #4:
score: 0
Accepted
time: 2ms
memory: 3400kb
input:
2 1 1 2 1 2
output:
1 2 2 1
result:
ok good!
Test #5:
score: 0
Accepted
time: 2ms
memory: 3440kb
input:
4 1 1 1 1 2 2 3
output:
2 2 4 1 2 3 2
result:
ok good!
Test #6:
score: 0
Accepted
time: 2ms
memory: 3468kb
input:
8 1 1 1 1 1 1 1 1 3 1 4 5
output:
2 4 8 5 4 1 4 7 6 3 2
result:
ok good!
Test #7:
score: 0
Accepted
time: 1ms
memory: 3368kb
input:
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 1 1 1 ...
output:
500 1 468 1 91 1 27 1 214 1 405 1 266 1 244 1 151 1 57 1 314 1 500 1 122 1 435 1 312 1 133 1 182 1 228 1 282 1 389 1 75 1 453 1 330 1 11 1 198 1 41 1 361 1 484 1 106 1 419 1 296 1 167 1 288 1 179 1 304 1 427 1 114 1 492 1 369 1 49 1 206 1 19 1 338 1 461 1 8...
result:
ok good!
Test #8:
score: 0
Accepted
time: 2ms
memory: 3432kb
input:
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 1 1 1 ...
output:
1 500 158 159 160 161 162 163 164 165 166 167 168 169 170 171 1 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 172 127 128 129 130 131 132 133 134 135 136 137 138 139 140 157 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 141 221 222 223 224 225 226 227 228 229 230 231 232 ...
result:
ok good!
Test #9:
score: 0
Accepted
time: 6ms
memory: 6416kb
input:
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 1 1 1 ...
output:
2 1 158 499 159 160 161 162 163 164 165 166 167 168 169 170 171 1 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 172 127 128 129 130 131 132 133 134 135 136 137 138 139 140 157 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 141 221 222 223 224 225 226 227 228 229 230 231 2...
result:
ok good!
Test #10:
score: 0
Accepted
time: 3ms
memory: 4760kb
input:
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 1 1 1 ...
output:
-1
result:
ok no solution
Test #11:
score: 0
Accepted
time: 2ms
memory: 3756kb
input:
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 1 1 1 ...
output:
11 40 168 177 187 135 142 152 225 239 194 203 213 35 42 52 62 14 16 104 114 124 68 78 88 414 432 379 389 399 406 479 489 440 458 467 289 299 306 254 264 278 46 164 171 181 129 143 224 233 243 190 197 207 217 43 61 8 18 28 98 108 118 69 87 408 418 428 435 383 393 391 488 497 444 470 461 283 293 307 ...
result:
ok good!
Test #12:
score: 0
Accepted
time: 1ms
memory: 4084kb
input:
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 1 1 1 ...
output:
250 2 197 266 2 209 469 2 66 500 2 91 406 2 136 297 2 187 314 2 111 389 2 121 437 2 74 484 2 94 330 2 212 267 2 205 453 2 79 376 2 175 361 2 99 427 2 143 251 2 177 381 2 72 369 2 231 305 2 1 461 2 196 275 2 70 338 2 41 492 2 56 398 2 150 476 2 203 322 2 239 259 2 159 445 ...
result:
ok good!
Test #13:
score: 0
Accepted
time: 4ms
memory: 4716kb
input:
484 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
22 22 160 129 152 224 187 208 55 31 104 69 78 243 417 383 468 428 275 296 263 350 359 327 22 156 132 147 221 190 36 45 8 105 120 72 404 372 381 465 440 439 286 256 345 354 316 22 171 136 145 238 202 211 46 26 96 67 76 403 375 461 424 441 284 293 265 351 360 331 22 155 178 215 230 228 212 58 7 30 ...
result:
ok good!
Test #14:
score: 0
Accepted
time: 2ms
memory: 4712kb
input:
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 1 1 1 ...
output:
55 9 146 191 43 16 417 382 439 256 319 9 181 244 205 123 431 475 460 307 323 9 177 229 209 28 404 479 436 343 324 9 167 200 61 98 87 472 437 308 311 9 161 227 125 122 79 481 462 265 365 9 144 204 47 110 81 468 456 274 326 9 156 152 10 95 85 374 440 259 334 9 160 188 211 32 415 376 490 270 355...
result:
ok good!
Test #15:
score: 0
Accepted
time: 0ms
memory: 4796kb
input:
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 1 1 1 ...
output:
4 125 160 162 169 171 176 178 185 187 130 132 139 157 146 148 155 141 225 227 234 236 241 243 250 189 194 196 203 205 210 212 219 33 38 40 126 49 54 56 47 3 8 10 17 19 24 26 96 98 103 105 112 114 119 121 65 67 72 74 81 83 88 90 409 411 416 418 425 427 432 434 379 381 386 388 395 397 402 404 474 476 ...
result:
ok good!
Test #16:
score: 0
Accepted
time: 2ms
memory: 3472kb
input:
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 1 1 1 ...
output:
27 5 176 157 230 195 35 5 171 149 233 190 43 5 168 131 235 193 37 5 169 133 220 200 33 17 165 137 151 192 215 54 26 113 119 74 418 406 477 483 438 283 255 21 158 128 221 199 36 126 18 107 122 80 417 388 393 480 458 468 308 271 353 370 326 21 167 145 231 242 210 46 25 98 110 88 426 434 405 494 ...
result:
ok good!
Test #17:
score: 0
Accepted
time: 0ms
memory: 3400kb
input:
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 1 1 1 ...
output:
19 13 167 133 147 220 243 209 36 126 8 99 113 124 84 27 173 180 151 225 236 192 217 48 10 18 116 71 78 422 421 396 474 495 447 468 295 254 269 353 368 326 341 27 163 186 152 228 239 200 41 55 4 27 118 69 80 414 426 382 400 481 499 454 284 302 258 276 357 359 330 27 174 130 137 232 244 193 211 49 ...
result:
ok good!
Test #18:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
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 1 1 1 ...
output:
7 18 164 171 178 185 130 137 144 151 220 227 188 241 248 193 200 207 214 34 64 158 165 1 179 186 131 138 145 152 221 228 235 242 249 194 201 208 215 35 43 52 54 47 3 11 20 22 31 96 104 113 115 124 110 71 80 82 91 93 412 250 423 432 434 380 389 391 400 402 473 482 437 493 495 440 449 451 460 462 282...
result:
ok good!
Test #19:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
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 1 1 1 ...
output:
4 56 160 162 169 171 176 178 185 187 130 132 139 157 146 148 155 141 224 226 233 235 240 242 249 189 194 196 219 205 210 212 203 34 39 41 48 50 55 57 2 4 9 11 18 20 25 27 97 99 104 106 113 115 120 122 66 68 56 161 163 168 170 177 179 184 186 131 133 138 140 147 149 154 156 225 227 232 188 241 243 2...
result:
ok good!
Test #20:
score: 0
Accepted
time: 1ms
memory: 4020kb
input:
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 1 1 1 ...
output:
2 11 158 161 162 165 166 169 170 173 174 177 178 488 159 160 163 164 167 168 171 1 175 176 179 180 181 182 183 184 185 186 187 172 127 128 129 130 131 132 133 134 135 136 137 138 139 140 157 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 141 220 221 222 223 224 225 226 227 228 229 230 ...
result:
ok good!
Test #21:
score: 0
Accepted
time: 3ms
memory: 4864kb
input:
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 1 1 1 ...
output:
-1
result:
ok no solution
Test #22:
score: 0
Accepted
time: 3ms
memory: 4840kb
input:
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 1 1 1 ...
output:
-1
result:
ok no solution
Test #23:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
493 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
17 1 161 1 163 1 171 1 169 1 162 1 168 1 156 1 167 1 159 1 158 1 165 1 164 1 166 1 1 1 172 1 157 477 160 173 174 175 176 177 178 179 180 181 182 183 184 170 125 126 127 128 129 130 131 132 133 134 135 136 137 138 155 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 139 217...
result:
ok good!
Test #24:
score: 0
Accepted
time: 2ms
memory: 3512kb
input:
493 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
17 1 161 1 163 1 171 1 169 1 162 1 168 1 156 1 167 1 159 1 158 1 165 1 164 1 166 1 1 1 172 1 157 477 160 173 174 175 176 177 178 179 180 181 182 183 184 170 125 126 127 128 129 130 131 132 133 134 135 136 137 138 155 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 139 217...
result:
ok good!
Test #25:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
493 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
17 16 164 125 134 148 228 241 206 43 58 9 25 100 123 93 408 247 16 1 170 136 152 227 188 204 42 51 4 23 97 108 83 407 419 16 163 179 132 139 232 192 201 215 50 2 29 111 64 76 92 415 16 156 183 143 219 185 231 199 38 54 15 24 99 118 69 405 426 16 172 127 140 223 239 190 212 44 57 18 95 62 68 84 4...
result:
ok good!
Test #26:
score: 0
Accepted
time: 3ms
memory: 3648kb
input:
493 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
17 16 164 125 134 148 228 241 206 43 58 9 25 100 123 93 408 247 16 1 170 136 152 227 188 204 42 51 4 23 97 108 83 407 419 16 163 179 132 139 232 192 201 215 50 2 29 111 64 76 92 415 16 156 183 143 219 185 231 199 38 54 15 24 99 118 69 405 426 16 172 127 140 223 239 190 212 44 57 18 95 62 68 84 4...
result:
ok good!
Test #27:
score: 0
Accepted
time: 0ms
memory: 4324kb
input:
493 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
17 16 164 125 134 148 228 241 206 43 58 9 25 100 123 93 408 247 16 1 170 136 152 227 188 204 42 51 4 23 97 108 83 407 419 16 163 179 132 139 232 192 201 215 50 2 29 111 64 76 92 415 16 156 183 143 219 185 231 199 38 54 15 24 99 118 69 405 426 16 172 127 140 223 239 190 212 44 57 18 95 62 68 84 4...
result:
ok good!
Subtask #2:
score: 7
Accepted
Test #28:
score: 7
Accepted
time: 2ms
memory: 3336kb
input:
1 15 1 1
output:
15 1 1 1 1 1 1 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 good!
Test #29:
score: 0
Accepted
time: 1ms
memory: 3492kb
input:
1 500 1 1
output:
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...
result:
ok good!
Test #30:
score: 0
Accepted
time: 3ms
memory: 3464kb
input:
1 3000 1 1
output:
3000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 good!
Test #31:
score: 0
Accepted
time: 2ms
memory: 4248kb
input:
1 15000 1 1
output:
15000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 good!
Test #32:
score: 0
Accepted
time: 0ms
memory: 3304kb
input:
2 2 1 1 1
output:
3 1 1 1 1 1 2
result:
ok good!
Test #33:
score: 0
Accepted
time: 2ms
memory: 3228kb
input:
2 1 2 1 2
output:
-1
result:
ok no solution
Test #34:
score: 0
Accepted
time: 2ms
memory: 3404kb
input:
3 1 2 3 1 2
output:
3 2 2 3 2 2 3 2 1 3
result:
ok good!
Test #35:
score: 0
Accepted
time: 0ms
memory: 3332kb
input:
3 3 2 1 1 3
output:
-1
result:
ok no solution
Test #36:
score: 0
Accepted
time: 2ms
memory: 3304kb
input:
3 2 2 2 1 2
output:
3 2 2 1 2 3 1 2 3 2
result:
ok good!
Test #37:
score: 0
Accepted
time: 2ms
memory: 3480kb
input:
15 50 49 48 47 46 45 44 43 42 41 40 2 1 1 1 1 10
output:
50 10 11 10 9 7 6 5 4 3 2 1 10 11 10 8 7 6 5 4 3 2 1 10 11 10 8 7 6 5 4 3 2 1 10 10 9 8 7 6 5 4 3 2 1 10 11 9 8 7 6 5 4 3 2 1 10 10 9 8 7 6 5 4 3 2 1 10 11 10 8 7 6 5 4 3 2 1 10 11 10 9 8 7 6 5 4 2 1 10 11 10 9 8 7 6 5 4 2 1 10 12 10 9 8 6 5 4 3 2 1 10 11 10 9 8 6 5 4 3 2 1 10 11 10 9 8 6...
result:
ok good!
Test #38:
score: 0
Accepted
time: 0ms
memory: 3268kb
input:
15 51 49 48 47 46 45 44 43 42 41 40 1 1 1 1 1 10
output:
-1
result:
ok no solution
Test #39:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
10 430 3078 390 349 3750 906 377 3374 1795 551 1 4
output:
3750 4 6 2 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5 4 1 9 8 5...
result:
ok good!
Test #40:
score: 0
Accepted
time: 6ms
memory: 3732kb
input:
500 4 99 56 16 7 39 5 8 3 18 15 30 19 27 46 47 24 55 1 7 21 1 13 5 53 32 12 98 12 121 3 118 25 15 8 32 29 7 13 3 29 94 22 4 12 37 15 52 14 9 59 22 3 16 9 77 5 17 41 22 16 6 3 32 33 34 18 1 28 4 72 4 3 40 21 13 22 16 42 77 2 16 1 1 10 11 3 34 21 28 4 173 24 57 17 9 20 116 21 72 17 165 28 30 6 13 86 1...
output:
5000 3 377 316 249 3 284 395 282 3 483 395 282 3 483 395 282 3 483 395 282 3 483 395 282 3 47 395 282 3 200 395 282 3 200 395 282 3 105 395 282 3 441 395 282 3 200 395 282 3 70 395 282 3 1 395 282 3 53 395 282 3 462 395 282 3 333 46 282 3 72 395 282 3 462 395 282 3 462 395 282 3 ...
result:
ok good!
Test #41:
score: 0
Accepted
time: 1ms
memory: 3796kb
input:
500 30 23 12 48 4 11 119 12 15 24 33 9 22 46 42 7 18 49 9 1 43 3 4 43 31 11 4 7 33 30 13 5 36 3 20 2 40 37 7 1 8 43 34 12 2 37 99 38 59 36 24 18 68 23 9 24 33 1 13 10 12 2 7 7 1 5 73 7 7 32 2 13 7 49 41 20 160 69 11 61 25 35 15 22 32 66 47 45 34 14 12 7 9 43 4 42 2 24 29 16 11 6 5 5 8 11 42 3 48 20 ...
output:
200 75 189 92 41 204 332 91 168 323 334 495 237 314 180 182 299 277 221 179 403 445 198 266 11 312 358 33 253 379 478 37 254 96 21 212 246 14 421 109 18 124 424 485 302 361 407 274 465 467 327 458 86 53 368 442 398 391 303 397 484 401 131 366 200 389 47 265 196 447 489 470 316 336 297 77 284 75 468...
result:
ok good!
Test #42:
score: 0
Accepted
time: 4ms
memory: 3768kb
input:
500 6 60 24 11 17 58 8 42 30 60 38 34 54 23 5 12 32 6 35 11 60 42 35 60 25 60 37 40 5 22 24 26 17 17 60 21 7 29 13 7 56 12 8 16 8 20 11 60 12 60 32 56 30 55 12 23 26 60 60 6 18 60 60 21 21 16 28 23 60 9 16 4 8 5 20 4 60 59 39 20 8 27 8 7 6 8 10 30 18 15 60 60 41 48 17 24 17 60 10 42 6 13 22 21 14 18...
output:
60 250 72 380 101 379 219 263 369 7 121 395 99 467 411 376 488 499 225 111 497 105 185 224 203 264 443 118 34 295 110 5 362 89 298 374 328 367 249 80 496 64 409 417 438 194 103 254 431 152 317 351 31 167 158 165 424 299 240 57 490 198 475 157 255 275 67 434 156 440 233 277 38 402 53 176 125 464 244 ...
result:
ok good!
Test #43:
score: 0
Accepted
time: 3ms
memory: 3720kb
input:
122 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 121 ...
output:
122 121 33 34 35 36 37 38 39 40 41 42 43 44 45 46 1 48 49 50 51 52 53 54 55 56 57 58 59 60 61 47 2 3 4 5 6 7 8 9 10 11 12 13 14 15 32 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 16 94 95 96 97 98 99 100 101 102 103 104 105 106 107 62 109 110 111 112 113 114 115 116 117 118 119 120 121 122 108 63 65...
result:
ok good!
Test #44:
score: 0
Accepted
time: 1ms
memory: 3288kb
input:
498 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
output:
3 332 158 159 162 163 164 165 168 169 170 171 174 175 176 177 180 181 182 183 186 187 172 127 130 131 132 133 136 137 138 139 142 143 144 145 148 149 150 151 154 155 156 141 222 223 224 225 228 229 230 231 188 235 236 237 240 241 242 243 246 247 248 249 190 191 192 193 196 197 198 199 202 219 204 20...
result:
ok good!
Subtask #3:
score: 0
Dangerous Syscalls
Test #45:
score: 12
Accepted
time: 1ms
memory: 3452kb
input:
2 7 8 2 1 2
output:
8 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 1 2
result:
ok good!
Test #46:
score: 0
Accepted
time: 2ms
memory: 3324kb
input:
3 5 4 6 2 2 3
output:
6 2 2 3 2 1 3 2 1 3 3 2 1 3 3 2 1 3 3 2 1 3
result:
ok good!
Test #47:
score: 0
Accepted
time: 2ms
memory: 3424kb
input:
3 4 2 9 3 1 2 3
output:
9 1 3 1 3 1 3 1 3 1 3 2 1 3 2 1 3 3 2 1 3 3 2 1 3
result:
ok good!
Test #48:
score: -12
Dangerous Syscalls
input:
4 3 5 4 3 2 3 4
output:
result:
Subtask #4:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
0%