CT58317

The Thimblewick Lesser Followers

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

It is audit day at the wren hedges of Thimblewick. Theron spreads the ledgers 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 <= 3395; -1000000 <= a[i],x <= 1000000.

Example 1:

Input: 2495 -206859 354211 162272 -741410 828186 884828 417612 -674696 439137 -865392 -61664 -316253 -659934 561744 559283 -354039 -498438 359834 420655 -967908 552499 744984 -822270 431877 -934839 588936 -786078 81791 -334185 -71247 -977222 -862670 -678337 503539 -394016 389761 -597520 -645799 972000 -862112 -882476 -933906 -821613 -377011 875797 -911294 -123059 -855509 -157320 -944400 870232 -322287 363805 902841 -763454 -829829 385241 -340212 -246077 817000 349000 -415660 982444 -744765 -762509 -268629 -478432 -964902 482235 -691604 -186037 346131 692607 -284856 562495 -638601 277649 253084 681103 24955 -188392 947542 571169 -795635 121353 -774954 -932565 414167 -81352 -568474 349933 367010 964004 -401625 887859 -381429 106509 994948 -619003 -716421 175688 -626506 782933 909448 30496 -374314 6…
Output: 977 1661 1428 322 2259 2326 1737 407 1762 173 1160 838 424 1923 1920 787 614 1657 1732 37 1902 2140 222 1742 81 1945 269 1327 805 1138 27 173 394 1828 728 1684 488 437 2421 174 150 81 216 746 2277 114 1056 182 1016 66 2269 804 1639 2310 286 205 1663 777 901 2193 1621 697 2416 301 285 865 617 37 1777 363 967 1608 2033 846 1874 433 1524 1493 2016 1224 960 2348 1875 244 1332 270 79 1675 1084 508 1600 1615 2359 697 2248 724 1302 2390 449 333 1383 438 2115 2270 1223 727 1953 594 1355 556 237 100 271 1960 930 1109 758 531 1758 1755 1483 558 698 285 2266 2208 416 728 612 2311 1717 1905 926 2296 1597 2183 2130 1771 904 1322 1789 981 390 777 1778 385 1396 942 1877 328 1493 2234 1995 1027 812 2097 2290 2179 468 1623 37 1491 1795 1613 2155 744 1790 2039 43 1424 325 959 729 639 1048 1568 1753 1310 712…

Example 2:

Input: 111 -676312 441198 10304 -17579 -759518 507333 904335 -384756 -237576 981797 -24088 -319649 203548 639271 511075 -449362 -167889 -613500 -599135 678972 828991 701465 411823 670744 -650841 -879176 -180903 -378731 481930 593842 -870941 -281792 -320837 -132468 -601129 -947455 423633 -126409 550095 -567677 714387 -534575 -680086 -859981 -644275 135211 -149275 -71329 -813399 -657931 -303081 -636876 -770004 -529934 112858 507678 422031 224880 579865 447759 -816245 401837 -486217 -749346 -622597 -167470 548719 -538644 -657245 97491 979245 34132 -207191 129029 55653 -784977 549372 434481 145312 -477875 790039 -408194 -373350 587337 -256603 317935 -59520 -242218 -396595 714043 -793727 232297 -842623 140325 246099 461899 651963 67866 -84105 -555336 999261 201584 -209906 -484462 -904950 127955 -74413…
Output: 15 81 59 58 11 81 100 34 42 100 54 37 64 85 77 31 43 20 21 82 87 83 65 80 16 2 38 29 66 73 2 31 29 36 17 0 56 34 62 16 66 18 10 1 11 40 28 29 3 8 20 9 5 11 29 43 39 34 44 39 2 36 10 4 6 17 35 7 5 21 39 18 14 20 17 3 27 24 19 6 28 6 7 22 7 18 10 7 6 19 2 12 1 9 10 10 11 7 5 2 10 6 3 2 0 2 0 1 1 0 0

Example 3:

Input: 40 -604632 -286963 -688390 719965 981692 37772 -278384 -675655 -727999 463623 -755038 -634025 3332 52139 412092 -684697 -119738 -845442 781965 -681736 440625 808797 -49974 985336 787501 702480 831965 68942 -159076 -935515 -348092 424888 463359 -686734 -505750 -733451 128577 773130 -379704 -935079
Output: 12 15 6 29 34 19 14 9 5 23 3 7 13 13 15 5 10 2 17 4 12 16 8 16 14 12 13 8 7 0 5 6 6 2 2 1 2 2 1 0

Constraints:

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

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