CT46048

Gleaming crates Lesser Followers

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Qadir found an old ledger of crates in the cellar attic at the crystal caves of Luminar. The margin notes pose a precise question. Task: For each position i, print how many elements to its right are strictly smaller than a[i]. Input format: First line: n. Second line: n integers. Output format: Print n counts space-separated. Constraints: 1 <= n <= 2629; 0 <= a[i],x <= 1000000.

Example 1:

Input: 1094 931220 629510 889865 674111 981185 398702 431917 564096 965317 566903 430890 40046 387150 633595 628870 989895 82785 449934 836457 352146 68462 817291 777416 424161 165402 167316 206600 55316 188128 364243 214169 97537 220962 542458 256321 106952 301961 374379 78741 243871 127865 93855 796258 553804 927765 914505 829428 209495 845315 153098 355855 111477 824024 487303 650085 519763 773976 272767 59865 697129 154715 957194 586333 593121 571950 670922 588926 63065 167523 278590 662855 221620 513099 104548 232432 69167 879458 294288 519820 407218 142890 894626 90364 896412 331521 832692 851200 773865 978499 405510 77448 428424 164244 315238 197890 819467 868791 140162 279547 262120 409318 808697 93419 485621 488841 815225 674343 631963 335483 602989 813041 906543 105828 428946 388354 107…
Output: 1007 679 962 723 1056 433 474 615 1029 619 473 38 420 681 671 1061 89 491 889 379 63 869 826 460 174 175 225 49 197 383 234 103 240 578 276 112 320 389 81 261 134 99 819 578 961 949 859 222 877 154 366 117 850 508 662 541 797 286 50 710 155 971 601 609 589 672 602 53 164 288 659 230 528 105 239 61 883 297 529 406 139 895 89 894 330 827 850 772 970 402 75 425 157 307 189 813 857 135 278 260 396 791 93 478 481 796 648 613 324 587 789 873 102 416 373 104 941 169 966 490 365 0 230 438 154 791 193 549 335 71 782 77 593 768 71 310 801 97 24 431 226 407 744 446 676 45 28 765 135 179 723 156 395 356 519 327 352 114 187 852 144 779 641 613 783 789 527 326 31 532 417 274 0 95 378 403 210 394 791 201 377 845 428 575 122 755 864 166 351 95 581 355 384 542 212 325 238 722 832 670 262 33 267 822 733 5 8…

Example 2:

Input: 1 278660
Output: 0

Example 3:

Input: 1093 924962 423158 472082 127831 565715 328733 46100 281912 916018 668741 392094 591083 235420 946132 523956 104123 960289 850645 218557 216608 967705 90205 745411 564664 833746 655704 251694 885226 171613 879634 604817 839124 206762 607850 248016 772107 799066 470683 579826 900718 218398 953722 729473 995040 91711 148595 808355 828309 907094 729534 900069 58478 263487 575719 598819 432155 658934 776451 53846 470032 769668 307475 844459 783632 915535 741635 500452 463291 437796 216847 468259 62043 226159 616738 343670 311058 175016 135279 298614 405697 237293 509767 544048 577718 104181 873699 420283 644763 821107 6793 941727 951495 505731 782546 497794 431606 66244 63651 478510 597839 773434 655094 880227 843655 216651 136477 720670 464429 963787 342429 326524 428445 275497 172458 281686 …
Output: 1013 461 517 138 608 360 45 312 998 719 421 627 260 1018 564 117 1034 915 239 232 1039 96 789 594 889 690 273 944 189 937 635 891 215 641 269 804 828 500 607 951 234 1003 754 1045 98 159 839 862 955 752 941 59 277 592 618 448 678 796 54 492 786 321 870 798 947 759 527 484 451 226 486 62 233 624 356 322 187 139 311 411 245 523 548 577 112 883 425 642 819 4 944 952 516 773 507 432 66 63 478 586 758 640 873 834 218 136 701 465 947 343 325 424 278 178 282 371 201 517 690 608 972 152 656 697 379 409 223 823 671 492 85 918 176 957 763 389 390 57 344 578 692 672 395 509 381 617 549 203 643 319 890 856 456 634 450 752 934 304 361 865 429 729 763 407 391 509 739 925 316 368 701 93 614 892 461 671 828 559 424 438 893 169 680 787 515 197 196 246 77 201 461 698 510 477 470 353 638 242 662 460 595 418 …

Constraints:

1 <= n <= 2629; 0 <= a[i],x <= 1000000.

Loading...
Test Cases:No test cases
No test cases available.
Gleaming crates Lesser Followers - MEDIUM Coding Problem | CodeTikki