QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#865402 | #8120. Dizalo | Unforgettablepl# | 35 | 18ms | 9180kb | C++20 | 2.1kb | 2025-01-21 17:54:59 | 2025-01-21 17:55:00 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
struct fenwick {
vector<int> tree;
fenwick(int n):tree(n+1){};
void add(int k,int x){
while(k<tree.size()){
tree[k]+=x;
k+=k&-k;
}
}
int get(int k){
int ans = 0;
while(k){
ans+=tree[k];
k-=k&-k;
}
return ans;
}
};
int32_t main(){
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int n,q;
cin >> n >> q;
vector<int> a(n+1);
vector<int> rev(n+1);
for(int i=1;i<=n;i++){
cin>>a[i];
rev[a[i]]=i;
}
vector<int> queries(q);
for(int&i:queries)cin>>i;
int ans = 0;
set<int> curr,curra;
reverse(queries.begin(),queries.end());
fenwick activePpl(n);
fenwick activeSpecial(n);
fenwick addedSpecial(n);
vector<bool> present(n+1,true);
auto add = [&](int x){
ans++;
present[x]=true;
activePpl.add(x,1);
// case 1: if it isn't a good one
auto upiter = curr.upper_bound(x);
if(upiter!=curr.end() and a[*upiter]<a[x]){
auto iter = curra.upper_bound(a[x]);
int idx = n;
if(iter!=curra.end())idx=rev[*iter]-1;
ans+=activeSpecial.get(idx)-activeSpecial.get(x);
addedSpecial.add(x,1);
addedSpecial.add(idx+1,-1);
return;
}
// Case 2: it's a good one
activeSpecial.add(x,1);
// TODO: Fix
{
int offset = addedSpecial.get(x);
addedSpecial.add(x,-offset);
addedSpecial.add(x+1,+offset);
}
int pre = 0;
for(int i=1;i<x;i++){
if(present[i] and a[i]>a[x])pre++;
}
ans+=pre;
addedSpecial.add(x,pre);
addedSpecial.add(x+1,-pre);
auto iter = curr.insert(x).first;
curra.insert(a[x]);
while(iter!=curr.begin()){
if(a[*--iter]>a[x]){
ans-=addedSpecial.get(*iter);
activeSpecial.add(*iter,-1);
curra.erase(a[*iter]);
iter = curr.erase(iter);
}
}
};
{
for(int&i:queries)present[i]=false;
for(int i=1;i<=n;i++)if(present[i])add(i);
}
vector<int> answers = {ans};
for(int&i:queries){
add(i);
answers.emplace_back(ans);
}
reverse(answers.begin(),answers.end());
for(int&i:answers)cout<<i<<' ';
cout << '\n';
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 16
Accepted
Test #1:
score: 16
Accepted
time: 0ms
memory: 3584kb
input:
100 99 46 70 52 75 41 25 95 48 22 33 87 40 62 68 67 32 66 23 81 77 19 98 44 26 53 71 78 100 28 27 45 65 20 97 31 7 57 43 21 2 92 9 83 96 60 17 64 36 59 51 50 79 29 89 85 90 72 47 94 1 13 49 73 18 34 4 88 8 69 24 16 86 5 14 11 82 84 39 15 42 74 80 63 76 38 54 37 55 91 10 30 6 58 93 61 35 99 3 12 56 1...
output:
385 381 376 372 367 363 359 354 350 346 342 337 333 328 323 318 314 309 305 300 295 291 286 282 278 274 269 264 259 255 251 247 242 238 233 229 226 221 217 213 211 206 203 198 193 188 184 179 175 170 166 162 157 153 148 143 138 133 129 124 123 120 117 113 110 107 105 101 99 95 92 89 85 83 80 78 74 7...
result:
ok single line: '385 381 376 372 367 363 359 35...3 29 27 24 22 18 14 10 7 3 2 1 '
Test #2:
score: 16
Accepted
time: 0ms
memory: 3584kb
input:
100 99 97 59 27 26 7 38 44 16 43 95 21 81 77 22 11 6 73 80 57 17 41 10 46 78 99 23 70 66 30 31 86 98 28 75 45 71 29 35 3 64 63 42 67 83 9 56 15 33 72 76 90 39 40 96 2 91 87 18 60 100 32 51 1 52 93 37 61 55 88 82 50 92 20 4 89 34 12 24 94 19 5 79 53 62 47 49 58 84 65 13 25 68 8 54 74 48 69 36 14 85 1...
output:
493 486 480 474 468 464 458 452 446 440 433 427 421 415 409 404 400 394 388 382 376 370 365 359 353 346 340 334 328 322 316 309 302 296 290 284 278 272 266 264 258 252 246 240 234 229 223 217 211 205 199 192 186 180 173 171 164 157 151 145 138 132 126 125 120 114 109 104 99 93 88 83 77 72 71 66 62 5...
result:
ok single line: '493 486 480 474 468 464 458 45...24 21 19 16 13 12 10 8 6 4 2 1 '
Test #3:
score: 16
Accepted
time: 1ms
memory: 3456kb
input:
100 99 28 41 66 23 70 85 56 17 84 73 20 7 61 29 77 80 93 86 38 74 69 8 30 91 71 16 15 81 12 10 88 24 40 90 94 3 18 11 50 99 22 60 65 26 89 34 13 59 100 92 83 97 82 63 49 33 14 35 6 48 42 36 95 68 39 37 44 45 51 87 19 57 78 27 43 54 79 21 76 58 53 25 52 96 5 64 55 62 46 47 75 72 67 2 9 4 32 98 1 31 1...
output:
267 265 262 259 257 254 251 248 246 243 240 238 236 233 231 228 225 222 219 216 213 210 208 206 203 200 198 196 193 191 189 186 184 181 178 175 173 171 169 166 163 161 158 155 153 150 147 145 142 139 136 133 130 127 124 121 118 116 113 111 108 105 102 99 96 93 90 87 84 81 78 76 73 70 68 65 62 59 57 ...
result:
ok single line: '267 265 262 259 257 254 251 24...9 26 23 20 17 14 12 10 8 5 2 1 '
Test #4:
score: 16
Accepted
time: 0ms
memory: 3712kb
input:
100 99 43 100 65 70 95 63 9 35 61 82 50 47 86 31 2 53 26 87 46 30 90 49 59 64 52 79 60 4 77 21 12 3 75 41 45 32 83 33 69 5 1 39 42 97 28 25 78 73 84 36 22 27 55 14 44 34 89 99 10 29 37 58 88 74 51 20 16 23 96 72 66 57 7 81 92 94 17 11 8 38 18 54 98 6 71 67 80 15 24 68 76 48 62 85 40 19 93 13 91 56 1...
output:
347 343 338 333 328 323 318 315 311 306 301 297 293 288 284 282 278 274 269 265 261 256 252 247 242 238 233 228 226 221 217 214 212 207 203 199 195 190 186 181 179 178 175 172 168 165 162 158 154 150 147 144 141 138 135 132 129 125 121 119 116 113 109 105 101 98 95 92 89 85 81 77 73 71 67 63 59 56 5...
result:
ok single line: '347 343 338 333 328 323 318 31...27 25 22 19 17 14 11 9 7 4 3 1 '
Test #5:
score: 16
Accepted
time: 1ms
memory: 3712kb
input:
100 99 13 34 87 11 51 59 56 58 46 77 72 22 50 44 55 94 27 45 36 73 89 54 60 29 49 91 19 23 88 33 66 18 65 1 38 81 93 70 63 32 20 64 41 82 48 90 69 97 76 75 30 71 80 10 84 14 78 2 31 62 85 4 43 98 37 52 16 3 9 25 7 24 15 100 83 6 5 17 40 21 35 61 57 67 79 42 53 95 86 99 8 28 47 26 68 92 96 39 74 12 1...
output:
497 490 483 476 470 463 456 449 442 435 428 421 414 407 400 393 386 379 372 365 358 351 344 337 330 323 316 309 302 295 288 281 274 267 266 260 254 248 242 236 230 224 218 212 206 200 194 188 182 176 170 164 158 152 147 141 135 129 128 123 118 113 111 106 101 96 91 86 85 82 78 76 72 68 64 60 58 57 5...
result:
ok single line: '497 490 483 476 470 463 456 44...24 21 18 17 15 13 11 9 7 5 3 1 '
Test #6:
score: 16
Accepted
time: 0ms
memory: 3584kb
input:
100 99 15 99 96 71 27 94 39 97 4 7 66 8 53 33 65 42 6 74 35 100 31 24 14 84 91 88 26 5 50 72 16 23 29 52 57 13 58 49 68 2 55 45 25 43 3 77 69 9 87 48 79 98 76 59 61 19 10 36 41 85 44 34 70 22 47 11 80 56 78 28 73 62 51 92 90 12 64 54 75 18 83 60 67 93 40 95 1 37 20 89 81 30 46 86 82 21 63 17 38 32 1...
output:
335 333 329 325 321 318 314 310 306 304 302 298 296 292 288 284 280 278 274 270 266 263 260 258 254 250 246 243 241 237 233 231 228 225 221 217 215 211 207 203 201 197 193 190 186 184 180 176 174 170 166 162 158 154 150 146 143 141 137 133 129 125 121 117 114 110 108 104 100 96 93 89 85 81 77 73 71 ...
result:
ok single line: '335 333 329 325 321 318 314 31...28 26 23 20 18 15 12 9 7 4 3 1 '
Subtask #2:
score: 19
Accepted
Test #7:
score: 19
Accepted
time: 1ms
memory: 3712kb
input:
1000 999 397 791 298 686 48 757 423 45 56 303 81 529 867 12 968 942 267 266 24 913 638 402 83 23 1000 44 696 79 666 980 990 394 364 973 453 531 433 106 818 351 654 911 133 166 78 734 521 951 20 32 157 959 207 272 574 507 378 612 388 248 268 234 629 870 6 53 450 342 345 568 513 807 189 885 127 868 23...
output:
7427 7419 7411 7403 7395 7387 7379 7371 7364 7356 7348 7340 7332 7324 7319 7309 7299 7291 7283 7278 7269 7261 7253 7245 7240 7230 7223 7215 7207 7199 7189 7179 7171 7163 7153 7145 7137 7129 7121 7113 7105 7097 7088 7080 7072 7064 7056 7048 7038 7033 7028 7020 7010 7002 6994 6986 6978 6970 6962 6954 ...
result:
ok single line: '7427 7419 7411 7403 7395 7387 ... 21 19 17 15 13 11 9 7 5 3 2 1 '
Test #8:
score: 19
Accepted
time: 0ms
memory: 3584kb
input:
1000 999 592 872 997 541 789 98 201 28 622 580 285 910 46 554 84 653 300 86 991 442 787 582 414 854 75 365 202 555 801 230 794 440 186 16 611 691 951 647 433 15 870 585 721 534 43 481 135 587 595 683 911 914 45 725 30 374 748 578 125 332 500 835 821 242 249 676 184 2 434 728 619 879 651 38 150 953 5...
output:
3936 3931 3925 3919 3914 3908 3904 3900 3897 3892 3887 3883 3877 3874 3869 3865 3860 3856 3852 3846 3841 3835 3830 3825 3819 3815 3810 3806 3801 3795 3791 3785 3780 3776 3773 3768 3763 3757 3752 3747 3744 3738 3733 3728 3723 3720 3715 3711 3706 3701 3696 3690 3684 3681 3676 3673 3668 3663 3658 3654 ...
result:
ok single line: '3936 3931 3925 3919 3914 3908 ...1 28 26 24 21 17 14 10 7 3 2 1 '
Test #9:
score: 19
Accepted
time: 0ms
memory: 3840kb
input:
1000 999 143 738 551 282 380 448 558 385 90 665 643 519 850 394 328 570 703 500 503 287 505 905 269 359 811 903 342 278 149 783 12 248 215 680 599 430 705 487 622 134 19 378 382 540 203 425 150 495 214 942 428 996 56 161 476 701 199 845 252 179 906 902 227 45 234 126 414 434 349 155 196 212 878 768 ...
output:
6098 6094 6087 6080 6075 6069 6063 6056 6050 6046 6039 6032 6025 6016 6010 6005 5998 5991 5984 5977 5972 5965 5956 5951 5945 5936 5927 5922 5917 5912 5903 5899 5894 5889 5882 5875 5869 5862 5856 5849 5845 5841 5835 5829 5822 5817 5811 5806 5799 5794 5785 5779 5770 5766 5761 5755 5748 5743 5734 5729 ...
result:
ok single line: '6098 6094 6087 6080 6075 6069 ...35 30 24 20 14 13 10 9 5 3 2 1 '
Test #10:
score: 19
Accepted
time: 1ms
memory: 3840kb
input:
1000 999 264 849 516 894 987 37 228 851 297 929 193 977 424 73 206 223 221 357 793 166 111 927 213 13 272 989 149 273 702 488 530 476 864 604 743 812 187 979 654 889 967 776 880 40 426 301 558 807 541 9 764 960 162 884 800 20 381 938 640 290 15 68 759 999 613 29 308 696 480 259 229 943 903 756 59 50...
output:
4844 4840 4833 4827 4820 4813 4809 4805 4798 4794 4787 4783 4776 4770 4766 4762 4758 4754 4748 4741 4737 4733 4726 4722 4718 4714 4707 4703 4699 4692 4686 4680 4674 4667 4661 4654 4647 4643 4636 4630 4623 4616 4609 4602 4598 4592 4588 4582 4575 4569 4566 4559 4552 4548 4541 4534 4530 4524 4517 4511 ...
result:
ok single line: '4844 4840 4833 4827 4820 4813 ...6 22 21 18 17 14 12 10 7 4 2 1 '
Test #11:
score: 19
Accepted
time: 1ms
memory: 3840kb
input:
1000 999 457 740 771 817 416 954 344 214 958 315 731 718 421 560 995 157 848 352 594 499 762 583 552 188 962 969 35 588 427 346 334 260 280 203 468 198 254 289 956 837 504 713 736 19 18 889 374 606 261 187 189 150 800 404 355 984 63 593 755 716 922 369 29 792 428 300 738 756 496 54 776 199 290 372 2...
output:
5467 5460 5453 5446 5439 5432 5425 5418 5411 5404 5397 5390 5383 5376 5369 5362 5355 5348 5341 5334 5327 5320 5313 5306 5299 5292 5285 5279 5272 5265 5258 5251 5244 5237 5230 5223 5216 5209 5202 5195 5188 5181 5174 5167 5161 5155 5148 5141 5134 5127 5120 5113 5106 5099 5092 5085 5078 5071 5064 5057 ...
result:
ok single line: '5467 5460 5453 5446 5439 5432 ...23 21 19 17 15 13 11 9 7 5 3 1 '
Test #12:
score: 19
Accepted
time: 1ms
memory: 3712kb
input:
1000 999 244 419 933 394 703 364 245 211 597 995 635 349 299 831 560 247 953 7 17 1000 823 46 225 624 420 493 367 85 772 409 739 695 44 550 352 341 907 964 791 896 881 740 131 167 902 985 53 877 870 307 642 602 48 282 265 886 774 997 719 764 854 653 727 838 690 141 529 96 391 640 94 404 841 738 542 ...
output:
8875 8866 8857 8845 8836 8824 8815 8806 8797 8785 8773 8761 8752 8743 8731 8720 8711 8699 8696 8691 8679 8667 8661 8652 8640 8631 8621 8612 8606 8594 8585 8573 8561 8555 8544 8535 8526 8514 8502 8490 8478 8466 8454 8447 8440 8428 8416 8410 8398 8386 8377 8365 8353 8347 8338 8329 8317 8305 8293 8281 ...
result:
ok single line: '8875 8866 8857 8845 8836 8824 ... 30 27 25 20 16 13 8 7 6 5 3 1 '
Subtask #3:
score: 0
Time Limit Exceeded
Test #13:
score: 0
Time Limit Exceeded
input:
100000 0 54924 86680 6903 21832 40927 66171 81252 88524 28245 14552 91271 54026 35740 56985 15692 36932 95402 73102 23923 73831 71006 48839 93060 18198 63733 44453 57468 14772 55276 47920 75498 29303 66457 77987 87216 44118 69356 60547 64621 88829 33392 37409 82671 89052 27257 47176 29071 57064 8205...
output:
result:
Subtask #4:
score: 0
Time Limit Exceeded
Test #23:
score: 46
Accepted
time: 16ms
memory: 9172kb
input:
100000 99999 76716 17445 57488 73176 31972 39961 39448 70858 98651 77741 3708 81901 80738 57340 69351 12147 16019 68896 88575 99024 32477 90730 93291 71046 97609 93522 83899 58358 72553 20908 76191 47968 99675 25286 1553 4868 55744 26031 363 86013 82165 35985 71467 42381 95346 77891 14986 65396 6019...
output:
898276 898265 898255 898245 898234 898224 898214 898204 898193 898182 898171 898162 898151 898140 898130 898119 898109 898099 898088 898077 898066 898056 898045 898034 898023 898012 898001 897990 897980 897969 897959 897948 897938 897927 897917 897908 897899 897889 897879 897870 897859 897848 897838...
result:
ok single line: '898276 898265 898255 898245 89...5 22 21 19 16 14 12 10 7 4 2 1 '
Test #24:
score: 46
Accepted
time: 15ms
memory: 9032kb
input:
100000 99999 81622 32490 93783 15738 55290 38408 72700 62139 44400 68065 90386 55683 95026 37025 7293 77705 4897 72985 99622 82002 44834 69034 41425 15878 46248 73652 78416 22877 34476 55257 39371 31940 20244 12335 89932 47894 39847 5278 93208 66279 23562 56958 8357 74449 43074 73940 998 72016 78291...
output:
633784 633777 633771 633764 633758 633751 633745 633738 633731 633724 633717 633710 633703 633696 633690 633684 633677 633671 633664 633657 633650 633643 633636 633630 633624 633617 633610 633603 633597 633591 633584 633578 633572 633566 633560 633553 633546 633540 633534 633527 633520 633514 633507...
result:
ok single line: '633784 633777 633771 633764 63...25 22 19 17 15 13 10 8 7 5 3 1 '
Test #25:
score: 46
Accepted
time: 18ms
memory: 9096kb
input:
100000 99999 5222 55507 65467 77448 39025 12388 58698 27848 45647 4729 89821 13940 2587 66094 31279 49122 35667 52458 14501 23862 19622 25876 53326 1656 15842 13665 61358 31223 49125 64603 42408 82452 74918 23851 98812 59815 3501 3805 44675 84114 44346 33472 52831 10020 98767 14003 33466 60881 3604 ...
output:
1043733 1043724 1043712 1043700 1043688 1043676 1043666 1043654 1043644 1043632 1043623 1043611 1043601 1043592 1043580 1043569 1043557 1043546 1043534 1043524 1043514 1043504 1043494 1043482 1043474 1043464 1043454 1043442 1043431 1043419 1043407 1043395 1043383 1043371 1043361 1043349 1043337 1043...
result:
ok single line: '1043733 1043724 1043712 104370...33 29 25 21 17 13 11 9 8 5 2 1 '
Test #26:
score: 46
Accepted
time: 14ms
memory: 9172kb
input:
100000 99999 34844 87804 74846 13226 74895 23358 78466 81381 39760 65522 6219 85501 13736 70566 48692 38477 39286 68852 13566 6261 37608 28578 98797 36661 93121 22420 66574 20310 19680 34753 60470 18001 2144 53142 31472 9065 59035 53918 8345 85207 32627 62527 60318 43931 10904 98941 7673 84681 13429...
output:
768841 768833 768824 768815 768807 768798 768790 768781 768772 768764 768756 768749 768740 768732 768724 768716 768708 768700 768692 768684 768677 768669 768661 768651 768643 768633 768625 768617 768609 768601 768593 768585 768577 768571 768563 768555 768547 768539 768531 768523 768514 768506 768498...
result:
ok single line: '768841 768833 768824 768815 76...22 20 18 16 14 12 10 8 6 5 2 1 '
Test #27:
score: 46
Accepted
time: 17ms
memory: 9172kb
input:
100000 99999 78397 93211 26827 10342 30510 64493 86321 17157 77113 78547 93568 26401 7604 60787 28432 17582 49707 8780 97596 66081 88082 23751 52240 62752 82764 48447 46898 85411 30811 75767 99052 86376 16775 61992 69616 43618 54657 24552 5211 46035 54677 51900 96686 84779 32962 65831 95499 87962 21...
output:
943172 943161 943149 943139 943129 943119 943109 943097 943087 943076 943065 943053 943043 943034 943024 943014 943004 942994 942985 942972 942962 942950 942940 942930 942920 942909 942899 942889 942877 942867 942856 942843 942831 942821 942811 942800 942790 942780 942770 942761 942751 942741 942731...
result:
ok single line: '943172 943161 943149 943139 94... 26 24 20 17 15 11 9 7 4 3 2 1 '
Test #28:
score: 46
Accepted
time: 16ms
memory: 9180kb
input:
100000 99999 96808 79338 55887 21768 44609 4167 5779 84438 59933 25053 83533 24691 16983 80250 84097 94515 42706 92403 40679 12639 15355 83897 19202 19828 31556 24681 87047 15972 23920 145 75069 41667 80813 10924 5688 85872 75639 91399 52626 41221 9760 22540 31764 59493 18370 49293 17887 19030 79244...
output:
1436449 1436433 1436417 1436402 1436388 1436373 1436360 1436347 1436331 1436316 1436302 1436286 1436272 1436258 1436242 1436226 1436210 1436195 1436179 1436164 1436150 1436136 1436120 1436106 1436092 1436078 1436064 1436048 1436034 1436020 1436013 1435998 1435983 1435967 1435953 1435940 1435924 1435...
result:
ok single line: '1436449 1436433 1436417 143640...28 26 22 19 15 13 12 9 7 4 2 1 '
Test #29:
score: 46
Accepted
time: 18ms
memory: 9172kb
input:
100000 99999 89173 2453 33916 23891 35971 89469 1715 13875 56567 78160 1697 45902 63754 79248 57985 43306 54190 76007 27967 5152 23972 36461 15626 82158 17491 71687 52020 78516 25091 89152 24560 39777 85789 64822 59389 15136 92264 90920 7448 11871 87520 57407 46074 37645 59853 31498 11754 66813 8254...
output:
999282 999269 999260 999249 999239 999228 999215 999208 999198 999187 999174 999167 999156 999145 999132 999121 999110 999099 999087 999077 999068 999058 999047 999037 999024 999014 999002 998991 998978 998968 998955 998945 998934 998921 998910 998899 998889 998876 998863 998854 998844 998831 998820...
result:
ok single line: '999282 999269 999260 999249 99... 32 26 21 20 17 12 9 8 7 4 3 1 '
Test #30:
score: 46
Accepted
time: 18ms
memory: 9176kb
input:
100000 99999 95755 21442 66348 86325 90631 77634 83351 21754 9049 82102 77134 77150 59992 27895 90858 7776 47950 56390 10067 88088 79702 12733 97377 21123 18315 29273 13552 96297 5260 88068 27418 36875 87856 5877 57493 64594 26745 89991 99855 13510 70283 38931 92097 93890 4784 31694 40746 1140 80439...
output:
1397597 1397581 1397566 1397550 1397534 1397518 1397502 1397486 1397471 1397457 1397441 1397425 1397409 1397393 1397378 1397362 1397348 1397332 1397316 1397302 1397286 1397270 1397256 1397240 1397225 1397210 1397194 1397179 1397163 1397149 1397133 1397118 1397102 1397086 1397072 1397056 1397040 1397...
result:
ok single line: '1397597 1397581 1397566 139755...25 22 19 16 15 13 11 9 7 5 3 1 '
Test #31:
score: 46
Accepted
time: 16ms
memory: 9180kb
input:
100000 99999 99427 61958 50582 3190 15327 46009 36688 59166 50938 16419 17104 36164 16347 61713 72159 87943 12871 54780 89913 94357 55476 64731 59933 98150 37271 22908 64097 49914 40316 41313 82930 62842 85364 70086 39784 18678 51456 9443 45291 53063 68226 92691 43073 27655 97237 51457 59825 94911 7...
output:
1106704 1106692 1106681 1106670 1106661 1106650 1106639 1106628 1106617 1106606 1106595 1106584 1106573 1106562 1106551 1106539 1106527 1106516 1106505 1106493 1106481 1106470 1106458 1106447 1106435 1106424 1106413 1106401 1106390 1106379 1106368 1106356 1106345 1106333 1106321 1106310 1106299 1106...
result:
ok single line: '1106704 1106692 1106681 110667...27 25 23 20 17 15 12 9 6 4 2 1 '
Test #32:
score: 46
Accepted
time: 14ms
memory: 9172kb
input:
100000 99999 86287 6926 30053 15737 65869 84479 60460 97168 41669 60855 51982 14460 34680 3303 73095 53753 12412 75797 9056 24344 36197 77751 55097 10702 43147 46415 71904 77123 33342 99058 65661 99944 8275 37484 65900 54453 36340 65493 87507 26111 52760 45085 74223 45372 81345 72569 87519 97790 344...
output:
1486360 1486342 1486331 1486317 1486304 1486287 1486269 1486252 1486234 1486219 1486202 1486187 1486174 1486159 1486148 1486130 1486115 1486102 1486084 1486072 1486058 1486043 1486025 1486010 1485998 1485983 1485968 1485950 1485932 1485917 1485899 1485882 1485864 1485853 1485838 1485821 1485806 1485...
result:
ok single line: '1486360 1486342 1486331 148631...4 28 27 22 19 14 9 8 6 5 4 3 1 '
Test #33:
score: 0
Time Limit Exceeded
input:
100000 99999 59586 72140 74928 93003 97864 74191 54452 76180 78035 59722 97702 50041 53724 92788 76452 56466 55623 63562 64589 61158 88013 63598 86292 78196 72660 65834 53119 84740 76678 71856 84026 63896 77962 51756 91371 93210 80643 51160 73534 55445 80661 96229 89183 85054 64970 71189 62265 92142...