CT60474

Chandler's Timeworn registers

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Chandler the clerk watches over the snowberry thicket of Winterholt's stores of registers. A careful computation stands between order and chaos. 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 <= 3481; -1000000 <= a[i],x <= 1000000000.

Example 1:

Input: 2433 568158495 437138595 224881880 187826801 789388093 138324704 552203840 604399626 123585839 37244254 396090277 472950077 738847937 411054457 216318516 74235950 574801792 158189575 113763689 787210675 27628235 251007286 252739772 499455172 797383301 385967428 421894859 480423632 591341842 884099014 31347566 786059193 612890829 446919502 595097859 628005887 307695817 806942988 736447303 815895130 556756189 649848657 221420091 767283178 371121935 617112760 118559833 449193925 304519151 623785562 838697802 376942232 551052103 628941728 249722010 743081901 57025394 370062364 338044089 306150360 184398702 947762679 137019205 817247300 424430174 728549546 505762183 275720332 570070546 193460275 599967800 910764945 176491338 306654880 903966224 388670270 240180664 919043200 402668483 507617630 …
Output: 1413 1114 569 471 1911 345 1367 1493 307 90 995 1178 1795 1035 541 183 1421 390 279 1892 68 632 638 1232 1910 965 1070 1185 1441 2136 73 1879 1495 1118 1450 1527 785 1923 1770 1941 1356 1582 549 1834 922 1498 287 1117 778 1511 1995 937 1337 1521 625 1766 140 912 843 777 453 2253 331 1923 1062 1733 1225 695 1377 476 1441 2151 427 773 2134 951 600 2165 984 1225 1878 37 2020 1653 1043 66 548 1745 718 1731 1700 1394 524 928 1000 1600 465 724 423 424 545 1554 747 76 509 285 994 1900 1908 1159 765 761 618 1780 903 785 2155 38 2276 43 173 682 90 217 1340 46 1640 1882 2059 744 219 722 1759 1803 956 1707 783 315 655 1375 691 795 1584 409 1518 881 374 852 801 1002 2041 561 246 2272 1350 1717 879 931 1259 246 1260 2238 1115 1342 1023 1146 356 1411 1667 235 1346 715 283 5 2139 1433 217 417 1192 1803 3…

Example 2:

Input: 58 674313421 365775169 343473447 111287408 627962677 345596450 61466506 703241617 105668431 450479839 457574683 203978119 607065042 256204957 321114854 141131631 137450900 556413199 928756106 603520369 684952182 267641665 309268551 883377617 837599210 222822911 509307504 890519613 655411048 235485949 958891982 83205660 242135233 453897264 712639838 806394418 284323612 782960925 760197005 185556319 848247816 466385357 331245692 962371598 834012793 728337637 724930463 721048834 862558358 378721809 344617644 704353969 841957891 904184841 304156976 208975262 820511918 471588495
Output: 35 22 19 3 30 19 0 30 1 18 19 4 23 8 12 2 1 17 37 17 18 6 8 30 26 3 13 27 13 3 26 0 2 7 10 15 2 13 12 0 14 5 2 14 10 8 7 6 8 3 2 3 4 4 1 0 1 0

Example 3:

Input: 397 623593415 677965139 319275529 892196875 530610090 268748174 24484500 390635152 109989084 57356299 51786560 357507936 939702482 107222739 296519416 956477076 564698791 846876276 293227744 694730636 513092700 738440867 779172054 617194022 10331088 808805726 947692114 318604237 971091987 641263294 399407144 375782193 721187068 163407032 945009554 419494502 85532361 741699029 318562740 861850764 566048360 192369220 699012445 852305036 2395429 862563153 485835960 362808922 585962544 96601748 738659940 663429860 460207831 809904790 977934809 281267020 304610677 953001623 974691156 393808273 429470410 536487629 713934413 239315093 160595169 384333883 870169267 656049922 509606755 889790316 754270516 827920308 380443480 141093773 776816662 908635028 766073908 226945642 283275816 770834985 6714…
Output: 227 247 114 346 195 89 8 143 30 17 15 123 359 27 96 362 197 316 94 242 180 263 288 210 4 294 349 104 356 218 140 126 250 45 342 143 20 256 101 302 188 52 230 298 0 299 160 114 190 20 244 210 150 273 335 80 90 322 329 124 137 169 222 70 41 118 285 198 157 287 238 267 115 34 248 290 241 61 77 241 197 240 150 182 196 155 83 148 249 234 236 220 253 248 14 23 120 98 171 157 67 117 239 146 42 130 143 199 126 219 31 195 70 143 66 129 244 179 138 191 259 116 133 242 212 225 139 138 268 46 250 53 177 169 208 61 1 203 226 237 86 181 65 26 89 140 43 133 185 207 215 123 93 33 122 50 45 70 221 1 47 130 214 157 222 80 147 7 30 55 172 108 207 150 107 219 182 150 207 107 160 100 208 65 17 19 84 192 203 133 103 203 146 179 92 11 89 198 56 189 127 100 57 17 156 16 89 85 48 176 37 120 22 137 42 28 0 42 60 34…

Constraints:

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

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