CT57245

The Vermilion Lesser Followers

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Caravans arrive at the cinnabar mines of Vermilion with crates of registers, and Esha the paymaster must account for every last one. 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 <= 3279; -1000000 <= a[i],x <= 1000000000.

Example 1:

Input: 947 622933790 665460589 822258800 424148594 906656532 890687864 940941621 959201174 234992427 585903481 665546297 450231120 770074993 330996427 555678658 938244843 336293386 678322194 633836237 891953306 408778238 585717555 565798042 672413925 225095386 240672988 647501312 921905120 955538364 600549098 696317845 315710274 844313849 210179660 181730873 202713113 581952876 592449265 506482298 917994021 509546522 924932219 311404770 192057266 55606535 87671826 291088403 229018575 886137829 303476935 806626611 383112019 103999648 288336505 339673988 445900773 469540293 94163896 2910392 247316445 586609915 426179750 530912316 87353184 401830120 373872894 89373081 61452761 201092725 797614044 300682998 762878788 483600956 901419830 114070416 414579633 330419114 244654877 482311792 585289489 2193…
Output: 597 623 763 418 844 826 879 894 232 567 620 440 703 334 539 868 340 626 600 818 410 561 544 616 214 233 603 839 870 569 629 312 759 201 178 191 549 556 482 824 485 831 304 184 50 79 277 217 787 293 706 370 97 273 328 412 435 90 1 230 535 396 490 77 384 351 79 56 179 681 282 650 440 776 99 383 309 221 435 518 195 161 847 53 82 662 102 752 174 333 135 9 2 750 501 418 787 232 141 339 697 550 573 566 812 558 712 665 824 751 556 177 489 481 204 777 194 711 482 402 368 168 646 350 814 735 403 625 803 54 282 649 486 177 612 774 345 172 585 378 140 473 578 21 54 594 740 151 572 67 67 360 123 504 489 712 738 133 87 688 445 27 234 326 69 264 691 264 191 705 93 129 479 633 208 95 250 326 451 485 233 570 552 209 179 211 255 247 186 641 43 690 234 127 221 509 488 102 720 474 712 369 639 251 388 54 478 …

Example 2:

Input: 68 291308086 659614898 938987703 159663044 968770340 620492919 732757172 4213106 387394857 480884599 589230554 427514778 739874443 375050547 984397040 325171251 641947491 111119966 274201512 424972249 127168324 589329237 90197267 837276665 789379579 259385848 223543120 920766090 622880193 686116367 967658613 147127279 300120613 157225789 982563392 549864852 938024306 223037965 91670969 868642942 65740594 539522463 811091184 33185860 564583150 433085925 702882931 706125321 782900441 242047257 854233562 373074188 590371077 973565901 135851170 312156005 65343496 605032531 12555146 979055452 189686824 734170331 530761078 305733130 267699042 861323131 682189200 806957227
Output: 20 42 59 12 59 38 44 0 24 27 31 25 40 23 53 21 32 6 16 20 6 24 4 35 32 12 10 35 23 24 34 6 11 6 33 16 29 7 4 26 3 12 21 1 11 9 13 13 14 4 14 7 8 13 2 5 1 5 0 8 0 4 2 1 0 2 0 0

Example 3:

Input: 2213 827887723 245438270 449601226 676253017 610555416 765624375 80440847 488240769 42694661 738304059 177303785 450498358 877958963 141832952 684957788 150088385 789739324 504522800 977841321 131953549 277390549 938654412 302083654 465211443 700212280 941582954 159760908 877180463 345271755 423511116 423625363 243194470 973849311 844819241 319632988 417392502 827019916 815383467 890190288 53460129 49816941 834894822 785010069 735464667 582036462 340528729 407001513 383938033 172190000 121643393 580853420 916168030 24981094 162270649 843387133 114183921 14307865 132805147 990125897 830069790 164476116 996604977 673434862 409364635 839875372 730295509 523162510 664115939 677174730 143128259 475063555 272745526 507964825 743058726 845678510 595985062 261674880 192384988 339654378 245734619 5…
Output: 1860 569 1036 1536 1417 1730 176 1128 100 1678 381 1034 1958 305 1554 320 1769 1162 2162 281 634 2081 697 1065 1584 2082 343 1944 802 963 964 557 2139 1865 741 950 1831 1809 1969 122 115 1840 1743 1652 1332 783 920 868 366 247 1325 2012 55 344 1843 232 29 275 2139 1816 344 2149 1493 917 1829 1626 1186 1480 1497 298 1064 608 1143 1643 1837 1348 579 403 767 549 1235 2045 1906 783 129 960 2064 238 1922 954 32 1469 1466 843 943 1651 1604 481 379 1244 568 1028 552 511 1211 1988 957 1438 261 2041 909 1586 1825 1120 1897 2077 2015 745 1920 588 884 307 1114 1606 1775 197 360 1981 1138 1064 1721 59 969 1841 205 83 1997 2008 462 1256 977 946 1221 489 951 1767 518 702 1827 299 641 661 396 1210 1782 260 993 1671 1662 848 1525 1187 822 1775 1335 194 1295 1735 1220 600 461 842 376 1135 1249 1058 284 679…

Constraints:

1 <= n <= 3279; -1000000 <= a[i],x <= 1000000000.

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