CT49819

Porter's Verdant weights

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the river town of Willowford. Porter spreads the weights records across the table and picks up a sharp pencil. 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 <= 1861; 0 <= a[i],x <= 1000000000.

Example 1:

Input: 1047 257644161 305278738 667062305 721431937 626979702 715943250 768789894 831000025 917685429 532106142 641234067 806317256 387445860 511868756 971007552 979495764 748508507 821660532 67473601 63642612 850265216 314569005 992352071 962683830 107270271 808131323 940371301 799994547 209735626 917732428 964700577 940971785 383851152 650177606 735894135 581371874 557249437 402241807 92971071 622444843 515684556 533665977 952139665 524851162 356821066 994883948 98430669 322331977 993091815 739682288 797992458 33354124 346292642 250627076 830612377 152401933 745361462 39287896 466488981 469499767 555518272 459475532 13596859 382956030 894422112 872923026 65957407 977707999 311141661 668184440 492820692 330245745 44168851 877414384 239656112 134864451 487828334 929457275 949879378 746187573 4008…
Output: 258 319 678 731 637 725 780 844 941 551 649 815 397 527 1001 1007 755 822 65 59 859 327 1011 984 106 809 957 801 211 926 981 954 388 650 733 587 561 405 93 620 522 541 955 531 367 994 99 330 988 725 779 30 353 245 809 151 727 35 463 466 543 452 13 376 874 848 59 958 313 643 480 327 39 848 224 130 474 898 922 713 387 497 595 524 181 585 74 139 583 700 181 684 44 388 3 288 548 175 762 497 331 737 65 23 725 518 541 500 398 904 726 701 307 807 612 557 481 896 321 916 232 173 161 704 490 20 733 648 893 32 671 2 24 356 771 885 825 789 228 95 120 669 869 834 327 79 385 573 296 15 881 765 505 310 863 738 525 870 465 677 443 541 826 588 78 783 366 551 646 558 357 431 30 489 595 459 186 626 121 429 856 714 600 567 784 98 137 110 777 802 668 328 643 782 33 658 255 655 293 249 3 691 77 291 22 88 838 7…

Example 2:

Input: 6 820057060 858804803 640787402 988461728 646639039 106120381
Output: 3 3 1 2 1 0

Example 3:

Input: 622 904158801 657827046 969286983 201543056 540092508 730545 969898737 736169161 94759967 581824954 987980801 603192028 666118291 964771664 720265366 870345806 729319367 576975019 781721286 195348678 259643051 847502730 887091113 888493095 440841299 737902590 375127813 891322735 393551722 994340578 129327804 671359317 605703258 206213984 960753175 99533378 852983201 334387414 769645734 589300137 336052102 32166854 146844057 640599445 976439788 547388546 220581714 58666329 950568544 250823746 51920194 955470338 230742746 922393901 430354195 547243199 303909468 703008524 433834353 985154396 734008041 618168627 816497550 389991775 480084456 423627977 804021369 793251621 510907802 60617595 779887597 405042331 57528991 815106477 381007049 723244478 735577536 859545558 835708841 496480815 464158…
Output: 549 396 593 115 314 0 590 441 53 342 601 359 393 582 421 514 429 339 458 108 152 493 512 515 256 433 214 514 224 586 71 389 352 114 558 56 487 183 440 338 184 18 76 363 560 304 120 35 540 140 31 539 123 520 237 297 161 383 236 551 403 341 449 210 262 230 437 431 277 35 420 219 32 437 201 385 393 454 444 263 251 199 443 69 452 505 286 487 79 513 114 292 357 503 406 287 66 305 461 257 521 484 93 261 513 170 336 84 80 311 85 313 477 166 34 308 345 108 435 72 280 15 227 12 369 201 174 206 200 430 377 138 63 284 77 356 235 3 375 53 128 134 404 258 468 388 317 221 363 44 172 13 11 130 115 96 275 352 317 419 356 102 453 263 388 438 186 0 10 94 378 163 272 183 177 118 64 100 48 302 424 197 311 79 288 195 295 28 145 123 210 73 220 55 64 270 23 339 239 179 29 227 254 14 14 375 12 194 120 226 401 323…

Constraints:

1 <= n <= 1861; 0 <= a[i],x <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.