CT59368

Admiral Counts the shelves

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Admiral runs the mint at the seal rocks of Barking Cove. Today the books show a list of shelves, and the numbers must be worked out before sundown. 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 <= 1303; 0 <= a[i],x <= 1000000.

Example 1:

Input: 956 300062 995868 212598 413485 807375 699498 683095 838356 433186 385962 330030 246840 593396 292951 967192 469392 687156 827755 186171 542125 86597 205761 515190 205484 716753 861708 654554 591250 777050 125870 618766 120169 338681 707028 461682 602087 823077 841457 460979 802747 697359 802348 55154 959360 642012 834866 386431 272031 834428 482127 933717 875861 951260 442348 31926 245811 371941 200037 970040 780696 553996 770918 933988 467143 180716 499237 13213 8978 935168 598163 704132 269752 101275 394694 604769 551111 591060 603047 639260 206013 603008 576174 512930 438601 441098 33449 535997 786482 699834 710917 138145 274968 540117 276730 646011 618170 48180 949063 336258 455508 798502 534525 872010 263798 436182 382470 384012 364512 736582 692748 466971 605887 999312 98128 308952 …
Output: 286 947 194 377 768 649 634 795 384 347 304 230 536 279 908 425 634 780 166 490 70 184 460 183 656 796 593 525 714 105 560 96 304 639 408 532 759 769 406 736 624 734 46 875 575 759 336 249 756 421 835 782 861 383 21 220 324 172 865 699 484 686 827 406 151 426 8 5 823 512 613 237 78 334 515 473 500 511 547 174 509 487 432 365 370 21 452 682 591 603 109 241 453 243 541 517 36 815 286 380 683 445 736 225 355 313 314 307 614 574 383 490 843 73 264 827 206 623 710 159 154 70 690 597 773 297 177 75 296 77 375 173 582 294 175 652 265 608 176 664 87 484 773 600 436 17 791 603 533 735 691 54 676 121 376 498 2 394 266 672 504 643 235 3 114 547 439 653 688 381 349 551 663 450 415 722 255 91 608 737 31 296 565 347 602 610 686 568 453 749 689 174 460 707 575 469 635 689 540 97 366 737 284 354 32 376 57…

Example 2:

Input: 5 763443 63204 992608 107876 584596
Output: 3 0 2 0 0

Example 3:

Input: 635 861726 371764 956189 494250 5233 427045 917287 12175 165955 485671 91542 335044 156532 770514 309642 194011 819020 261382 858183 967503 348542 78491 5457 39884 156862 755061 452283 863524 437820 516352 43461 630706 464632 762395 919137 676828 905790 910557 334621 864891 793402 888233 561620 714703 853851 191746 44173 272724 977888 419168 458098 860113 832531 722626 990665 113817 698537 25845 49556 752245 26378 310643 30684 158950 668626 280565 786060 286625 616340 64869 814499 368787 309243 67594 310569 454509 468485 323023 277931 940804 722261 296152 262791 20199 810313 700531 442506 743087 510130 37915 667546 605720 618048 22157 7048 585908 584981 278274 371517 286981 3172 854205 573525 879368 615984 610712 563368 167961 951908 951113 569050 618338 227739 447063 906097 530213 526956 …
Output: 538 234 612 302 1 264 574 6 95 295 56 201 88 472 184 111 493 150 521 598 201 50 1 23 85 458 264 515 254 297 25 379 268 454 549 407 537 538 191 507 460 523 324 425 495 105 26 151 572 242 261 497 479 428 574 68 408 13 26 437 13 171 14 78 387 150 439 153 350 29 446 201 163 29 163 243 247 168 144 524 406 153 135 9 433 388 231 407 264 18 368 326 334 11 2 311 310 140 190 144 0 443 297 457 324 320 291 75 504 500 292 320 108 223 466 267 262 330 378 201 309 31 246 265 414 189 81 178 475 350 78 84 5 59 190 64 283 422 281 215 155 486 6 67 179 415 143 101 202 37 298 467 256 171 237 443 310 338 104 82 168 407 126 374 54 408 175 439 355 321 91 64 305 345 427 298 42 416 235 184 22 436 338 57 289 422 199 294 296 107 235 332 134 312 284 141 51 357 291 233 49 266 341 89 326 124 33 164 36 421 410 23 310 41 1…

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Admiral Counts the shelves - MEDIUM Coding Problem | CodeTikki