QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#494001#9131. Bookshelf Trackingucup-team987#AC ✓89ms12936kbC++201.8kb2024-07-27 13:40:522024-07-27 13:40:53

Judging History

你现在查看的是最新测评结果

  • [2024-07-27 13:40:53]
  • 评测
  • 测评结果:AC
  • 用时:89ms
  • 内存:12936kb
  • [2024-07-27 13:40:52]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

void Solve() {
  int n, q;
  cin >> n >> q;
  vector<int> P(n);
  for (int i = 0; i < n; ++i) {
    cin >> P[i];
    --P[i];
  }
  vector<tuple<char, int, int>> qs(q);
  for (auto& [c, i, j] : qs) {
    cin >> c;
    if (c == 'E') {
      cin >> i >> j;
      --i, --j;
    }
  }

  int last = -1;
  for (int qi = 0; qi < q; ++qi) {
    if (get<0>(qs[qi]) == 'R') {
      last = qi;
    }
  }

  vector<int> p(n);
  for (int i = 0; i < n; ++i) {
    p[P[i]] = i;
  }

  if (last == -1) {
    for (auto [c, i, j] : qs) {
      swap(p[i], p[j]);
    }
  } else {
    vector<int> f(n);
    for (int i = 0; i < n; ++i) {
      f[i] = n / 2 <= p[i];
    }
    for (int qi = 0; qi < q; ++qi) {
      auto [c, x, y] = qs[qi];
      if (c == 'E') {
        swap(p[x], p[y]);
        swap(f[x], f[y]);
      } else {
        if (qi == last) {
          auto op = p;
          for (int z : {0, 1}) {
            vector<int> v;
            for (int i = 0; i < n; ++i) {
              if (f[i] == z) {
                v.push_back(i);
              }
            }
            if (z == 0) {
              ranges::sort(v, greater{}, [&](int i) { return p[i]; });
            } else {
              ranges::sort(v, {}, [&](int i) { return p[i]; });
            }
            auto it = v.begin();
            for (int i = 0; i < n; ++i) {
              if (f[i] == z) {
                p[i] = op[*it++];
              }
            }
          }
        }
      }
    }
  }

  for (int i = 0; i < n; ++i) {
    P[p[i]] = i;
  }
  for (int i = 0; i < n; ++i) {
    cout << P[i] + 1 << " \n"[i + 1 == n];
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  Solve();
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3588kb

input:

8 4
7 2 6 1 8 3 5 4
R
E 2 3
R
E 1 6

output:

7 1 3 6 2 4 5 8

result:

ok 8 numbers

Test #2:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

8 4
7 2 6 1 8 3 5 4
R
E 2 3
E 4 6
R

output:

7 4 3 1 2 5 6 8

result:

ok 8 numbers

Test #3:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

8 4
7 2 6 1 8 3 5 4
R
E 2 3
R
E 4 3

output:

7 6 4 1 2 3 5 8

result:

ok 8 numbers

Test #4:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

8 5
7 2 6 1 8 3 5 4
R
E 2 3
R
E 1 5
E 5 1

output:

7 6 3 1 2 4 5 8

result:

ok 8 numbers

Test #5:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

2 2
2 1
R
R

output:

2 1

result:

ok 2 number(s): "2 1"

Test #6:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

2 2
1 2
R
R

output:

1 2

result:

ok 2 number(s): "1 2"

Test #7:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

2 2
2 1
E 1 2
R

output:

1 2

result:

ok 2 number(s): "1 2"

Test #8:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

2 2
1 2
E 1 2
E 1 2

output:

1 2

result:

ok 2 number(s): "1 2"

Test #9:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

10 11
2 6 7 8 1 3 9 10 5 4
E 10 5
R
R
E 10 7
E 7 9
E 7 6
E 2 9
R
R
E 7 3
R

output:

10 9 8 3 1 2 4 5 6 7

result:

ok 10 numbers

Test #10:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

100 215
93 53 68 3 48 38 12 65 66 89 9 74 54 72 82 44 97 36 32 50 73 17 31 90 80 79 85 84 35 92 23 67 46 94 22 27 69 34 13 51 45 64 56 78 55 47 41 95 21 76 4 39 5 19 57 86 91 26 2 1 87 11 40 52 29 30 20 37 25 60 16 77 75 43 8 18 83 15 42 7 28 14 49 98 10 99 100 81 59 58 70 6 63 61 71 24 88 33 62 96
...

output:

100 97 95 94 92 90 84 82 81 80 79 78 77 76 74 73 13 71 68 67 66 65 64 63 61 55 54 51 50 48 47 46 45 44 38 35 34 29 28 27 26 25 24 23 21 19 16 12 11 4 1 2 3 5 6 7 8 9 10 72 14 15 17 18 20 22 30 31 32 33 36 37 39 40 41 42 43 49 52 53 56 57 58 59 60 62 69 70 75 83 85 86 87 88 89 91 93 96 98 99

result:

ok 100 numbers

Test #11:

score: 0
Accepted
time: 1ms
memory: 3648kb

input:

1000 828
998 776 975 539 368 42 225 13 566 299 956 830 114 663 689 246 721 887 588 942 305 767 31 900 587 367 86 849 150 298 762 41 688 959 402 451 545 259 558 769 835 615 26 571 832 371 219 369 390 266 54 290 247 265 569 642 579 901 654 969 166 889 518 792 421 212 891 831 714 731 825 916 335 898 46...

output:

1000 999 998 996 995 992 991 990 989 985 984 983 982 980 977 976 975 972 968 967 966 964 960 959 957 956 955 953 951 950 948 947 944 940 939 938 937 936 935 934 932 931 929 927 926 925 922 921 916 915 914 913 912 911 907 906 900 898 897 891 890 888 887 882 879 878 877 876 873 872 869 868 864 861 859...

result:

ok 1000 numbers

Test #12:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

5000 7828
483 4179 3566 2993 3747 2904 3836 3321 2123 1805 3619 2459 3264 1049 1409 3070 3940 2588 2263 2502 1142 4394 3263 4543 1729 4793 4944 1807 4315 918 2910 4723 3812 2466 3678 1756 2549 4337 1590 1127 140 2847 1307 45 1221 2379 2114 2514 233 145 2096 992 3088 2421 1717 2055 3075 2931 1302 108...

output:

5000 4998 4997 4995 4994 4991 4990 4987 4986 4985 4983 4977 4975 4974 4973 4972 4970 4968 4965 4962 4960 4957 4954 4953 4952 4951 4948 4947 4945 4943 4942 4937 4930 4929 4927 4924 4923 4922 4918 4917 4916 4913 4912 4909 4907 4905 4904 4903 4902 4901 4898 4897 4893 4892 4891 4890 4886 4882 4881 4880 ...

result:

ok 5000 numbers

Test #13:

score: 0
Accepted
time: 3ms
memory: 3740kb

input:

10000 18923
4157 2241 232 6393 9557 4321 1433 7335 5550 4829 5370 4378 3440 7619 9868 1381 9974 6543 5956 3289 8201 4864 7466 591 2377 4296 9648 3937 979 3112 9188 5320 3011 9401 8438 7662 8191 5552 6889 3164 3277 1573 8400 4891 6052 1074 3013 1713 1516 3731 3849 4362 6683 5168 687 4102 5962 2320 21...

output:

10000 9999 9996 9995 9990 9989 9987 9985 9984 9981 9979 9977 9976 9974 9966 9964 9962 9959 9955 9954 9952 9948 9947 9945 9938 9937 9936 9935 9934 9932 9928 9923 9921 9918 9917 9915 9914 9913 9909 9907 9900 9898 9895 9894 9893 9890 9886 9883 9880 9877 9874 9873 9872 9869 9867 9861 9860 9858 9857 9852...

result:

ok 10000 numbers

Test #14:

score: 0
Accepted
time: 9ms
memory: 4428kb

input:

25000 55849
22703 5281 9369 14113 10700 18003 23456 18995 23886 23011 2488 1348 10527 9490 5081 17085 7257 9052 23042 22634 22495 21975 21505 24774 2015 14447 17755 16832 9972 15747 17346 6906 15558 19874 13328 14881 21018 18055 16054 6441 21501 7275 23558 7017 797 11540 24591 7929 1533 421 22492 78...

output:

24998 24990 24987 24986 24982 24980 24975 24974 24973 24972 24971 24970 24968 24967 24966 24964 24962 24960 24948 24947 24946 24945 24942 24939 24938 24937 24936 24933 24928 24926 24925 24920 24913 24911 24910 24909 24908 24906 24904 24899 24898 24897 24894 24893 24890 24889 24888 24881 24880 24877 ...

result:

ok 25000 numbers

Test #15:

score: 0
Accepted
time: 16ms
memory: 5056kb

input:

50000 77885
29358 25358 32388 10751 26813 42091 25859 20004 18201 36433 46490 27368 21129 35996 31583 31537 31168 11487 37610 46191 24883 24271 37511 35775 13442 42852 40241 28470 11988 31695 18991 47933 42125 19172 31862 37410 46625 14874 48293 13786 40125 31904 5372 3590 42255 29697 20549 6018 257...

output:

49999 49994 49991 49989 49984 49980 49978 49975 49973 49967 49963 49961 49960 49959 49956 49955 49953 49952 49951 49949 49948 49946 49944 49940 49939 49936 49935 49929 49927 49926 49925 49924 49923 49922 49921 49916 49913 49911 49908 49907 49906 49905 49902 49900 49898 49897 49896 49893 49889 49888 ...

result:

ok 50000 numbers

Test #16:

score: 0
Accepted
time: 18ms
memory: 6304kb

input:

75000 128755
64183 72276 48393 320 38782 10977 72578 64754 49900 48827 28234 3230 44155 32898 17698 40770 66999 38370 54029 45644 45422 57386 56689 38479 26696 2931 34091 62790 63556 69919 61350 33120 74561 44142 10056 23522 32230 16243 13301 32054 61618 19973 34155 24139 455 8801 57024 13018 52479 ...

output:

75000 74997 74995 74992 74990 74989 74988 74986 74984 74983 74980 74979 74978 74977 74972 74971 74970 74969 74964 74960 74959 74958 74957 74955 74954 74952 74948 74946 74945 74944 74943 74942 74941 74939 74935 74933 74932 74931 74927 74926 74921 74920 74914 74909 74908 74907 74905 74900 74899 74898 ...

result:

ok 75000 numbers

Test #17:

score: 0
Accepted
time: 27ms
memory: 7064kb

input:

100000 148923
32500 12062 22279 34653 40571 34921 72336 48257 89229 35845 16302 12296 96849 6602 21141 52487 35036 59637 61357 39669 64585 2777 62698 9951 67048 83743 88947 91803 87321 66447 87580 63806 24016 2896 15492 9885 63676 14777 62492 48627 12470 54962 36776 70091 65839 58535 36768 75439 267...

output:

99999 99998 99997 99996 99994 99986 99978 99977 99971 99970 99965 99963 99961 99959 99958 99955 99954 99953 99952 99950 99948 99947 99946 99945 99944 99943 99942 99938 99933 99928 99927 99924 99923 99921 99920 99918 99914 99912 99911 99909 99908 99906 99904 99903 99902 99901 99900 99898 99897 99896 ...

result:

ok 100000 numbers

Test #18:

score: 0
Accepted
time: 30ms
memory: 8512kb

input:

150000 182713
85319 88715 72038 78870 13791 86398 13517 114281 145378 92333 15818 137821 136455 139799 54962 18599 65496 23134 137561 102022 106312 29412 148109 55515 136831 93614 11695 91221 55736 124471 64783 21878 67388 135293 34125 67469 115383 76193 120748 30728 96899 149779 51365 11929 141852 ...

output:

149999 149998 149995 149992 149990 149986 149985 149984 149982 149977 149973 149972 149971 149970 149969 149963 149959 149958 149957 149956 149953 149952 149951 149948 149947 149946 149945 149941 149940 149938 149937 149935 149934 149933 149932 149929 149928 149926 149919 149917 149910 149909 149904...

result:

ok 150000 numbers

Test #19:

score: 0
Accepted
time: 47ms
memory: 9372kb

input:

200000 200000
11558 58745 44752 164297 68764 108810 110412 117312 41036 110905 146460 36512 140745 118171 51956 87911 119660 70627 117051 50757 119636 75568 72870 191178 35171 107706 78404 26797 187391 57831 154967 16801 43330 131941 112161 3860 173556 20369 164367 25546 154714 63893 161989 13620 12...

output:

200000 199996 199994 199993 199992 199991 199990 199989 199988 199986 199984 199982 199981 199979 199975 199973 199971 199969 199967 199966 199965 199963 199960 199954 199953 199952 199948 199946 199945 199944 199942 199939 199937 199935 199933 199932 199931 199929 199927 199926 199922 199921 199920...

result:

ok 200000 numbers

Test #20:

score: 0
Accepted
time: 49ms
memory: 9400kb

input:

200000 199999
72376 120077 117418 171031 193609 164063 115568 30242 163772 58714 158069 75034 142247 153389 33706 87163 14776 180126 12240 101498 30763 18456 180621 39892 166421 189465 156016 101853 13649 162136 19926 132641 174294 192352 187205 193077 132353 36769 117692 81352 154877 10641 84561 37...

output:

199999 199997 199996 199995 199994 199989 199983 199982 199980 199978 199976 199972 199971 199969 199967 199966 199964 199962 199960 199959 199955 199954 199953 199952 199951 199948 199945 199942 199939 199938 199937 199936 199932 199931 199923 199921 199919 199917 199913 199910 199908 199907 199906...

result:

ok 200000 numbers

Test #21:

score: 0
Accepted
time: 45ms
memory: 9360kb

input:

200000 200000
56152 67232 121992 176142 51942 101298 152711 116190 128146 45216 194797 98177 51495 2073 175717 165156 81154 129684 85943 129097 73498 70969 4508 117426 147930 136830 151751 175840 68270 173452 195099 98050 103689 94415 37879 22634 129729 124958 51924 39180 139525 1070 133627 58107 13...

output:

199999 199998 199997 199992 199990 199989 199986 199984 199983 199975 199974 199971 199970 199968 199967 199965 199963 199962 199961 199960 199959 199958 199957 199956 199952 199950 199949 199945 199943 199941 199940 199938 199932 199929 199927 199923 199918 199917 199916 199914 199913 199912 199909...

result:

ok 200000 numbers

Test #22:

score: 0
Accepted
time: 58ms
memory: 9476kb

input:

200000 200000
181039 61240 95869 165946 18395 155894 36712 12670 155021 118255 120842 43473 96790 159886 168078 188597 18933 80232 164443 65660 112558 54045 140451 157942 123029 193707 100382 79727 51717 35480 190286 67788 72352 107698 41242 104842 157839 100635 152831 34862 40392 127539 164807 7163...

output:

199998 199997 199996 199995 199994 199990 199987 199985 199984 199982 199981 199980 199979 199978 199977 199976 199975 199974 199973 199971 199967 199964 199963 199962 199961 199960 199958 199957 199956 199955 199954 199953 199950 199942 199939 199936 199935 199933 199932 199930 199928 199927 199923...

result:

ok 200000 numbers

Test #23:

score: 0
Accepted
time: 60ms
memory: 9360kb

input:

200000 199999
102950 182112 5648 117866 146200 172026 195573 80322 149291 186557 37333 19419 61647 38356 195760 27720 95590 24907 147318 188900 3272 97587 100432 126703 52965 14358 81997 47054 119411 73070 133609 55254 98942 123566 95624 180372 136885 151046 134273 63564 114368 38545 90438 65806 117...

output:

200000 199997 199995 199990 199989 199987 199986 199984 199982 199981 199979 199975 199972 199970 199967 199965 199964 199962 199961 199960 199959 199957 199956 199953 199951 199949 199946 199945 199944 199939 199938 199937 199934 199933 199930 199928 199927 199925 199924 199923 199920 199919 199916...

result:

ok 200000 numbers

Test #24:

score: 0
Accepted
time: 56ms
memory: 9324kb

input:

200000 200000
74367 96791 80211 177112 185679 3426 113775 164068 123801 56645 168166 113374 40260 104624 7106 63550 123512 39960 33287 84838 143839 86885 63774 171085 128333 26175 178732 12356 105586 146060 140919 182620 185491 182839 8880 195854 115301 135261 11789 15493 176614 190308 104387 115409...

output:

199999 199998 199995 199993 199990 199989 199986 199983 199982 199977 199976 199975 199971 199965 199964 199955 199952 199951 199950 199947 199945 199942 65509 199940 199938 199936 199935 199930 199928 199927 199925 199923 199921 199920 199918 199917 199916 199914 199910 199909 199908 199906 199905 ...

result:

ok 200000 numbers

Test #25:

score: 0
Accepted
time: 62ms
memory: 9496kb

input:

200000 200000
2892 22905 156505 146884 198065 168969 759 25473 123134 87764 184881 147887 191619 162373 107003 9500 173287 178452 143542 132328 180189 110135 68680 112044 67080 40233 152113 184158 3756 115113 18070 162381 103211 11641 127285 99901 166557 104189 60531 70944 6908 77736 149471 61847 10...

output:

122719 199999 199998 199997 199996 106665 80815 79615 199986 199983 15388 84908 157843 32240 159398 31076 128539 16554 199965 199964 199962 21980 66574 90683 114031 179024 148822 44619 42746 199944 120847 89067 199939 197911 100324 86227 199934 199930 69130 152919 16936 141500 199920 34838 63463 575...

result:

ok 200000 numbers

Test #26:

score: 0
Accepted
time: 61ms
memory: 9404kb

input:

200000 200000
132598 172516 113666 129329 192144 78587 139959 170382 165164 193074 85591 138262 47315 91873 114234 136334 21415 14904 82660 171686 80457 160749 33276 28625 25517 92127 165093 151818 155315 79758 164064 29474 34500 148111 154418 44501 95743 102680 126104 151216 181886 117129 7832 1706...

output:

180309 199990 190453 118607 62567 116373 199978 199974 34453 166242 47029 187720 120272 121005 52827 141909 155565 51879 199957 199956 186929 199954 199953 53297 153537 109764 199944 180689 6685 38192 67227 117844 195914 27690 813 20289 30020 44457 119631 102054 105606 51221 173109 5795 168108 50691...

result:

ok 200000 numbers

Test #27:

score: 0
Accepted
time: 42ms
memory: 6996kb

input:

200000 200000
45477 17112 126823 21777 112967 151790 15168 112489 162031 11783 27093 172813 103461 115499 195630 1550 105346 90624 69934 86265 40830 131564 86018 77324 91688 62556 117665 40494 80007 56237 80932 175742 128449 194710 112576 56539 49368 52876 194331 41653 79897 142658 90386 157343 1128...

output:

16380 112050 24853 142767 181515 50497 120194 45387 88514 75818 143569 172813 149615 123358 74930 49892 105346 90624 162422 127406 40830 173786 187795 67096 188930 60581 83309 87524 14703 56237 80932 71361 93010 191953 121750 126461 87049 52876 194331 146014 78519 198739 28501 176693 112881 34232 13...

result:

ok 200000 numbers

Test #28:

score: 0
Accepted
time: 30ms
memory: 7056kb

input:

200000 200000
120382 115622 3433 72978 86087 142401 179585 176857 109811 63600 162146 2187 93044 148136 17987 178980 32354 187558 160088 80758 23069 102346 90366 193999 191938 27055 168096 28698 57467 64030 168134 156303 108158 187293 74505 145473 83211 160541 22435 70894 125971 46128 54011 185694 8...

output:

151168 155086 3473 34266 149235 99566 143499 40877 146509 192204 2708 169653 124394 148136 1447 35361 25895 187558 188519 4764 23069 102346 8687 193999 79107 188220 184504 109159 16728 115413 179052 197213 108158 171368 74505 123869 148707 29443 188929 106607 125971 75886 195410 60818 93712 35271 62...

result:

ok 200000 numbers

Test #29:

score: 0
Accepted
time: 43ms
memory: 9500kb

input:

200000 200000
58385 128369 139723 79335 146514 53250 12858 43942 47479 198578 94241 68643 122570 10825 26304 153432 65154 148154 171658 157219 111428 128573 109837 122808 134062 65812 162991 35737 156573 61828 55632 103801 69079 64595 119221 44521 95081 197612 1945 45387 145444 143047 131140 173310 ...

output:

199999 199998 199997 199996 199994 199992 199987 199986 199984 199981 199972 199971 199970 199969 199967 199966 199965 199962 199961 199957 199956 199955 199954 199951 199945 199943 199941 199939 199938 199937 199933 199926 199925 199924 199923 199922 199921 199920 199919 199916 199913 199912 199911...

result:

ok 200000 numbers

Test #30:

score: 0
Accepted
time: 38ms
memory: 9416kb

input:

200000 200000
134201 193943 184852 198817 152415 145934 179075 44865 60120 28910 198444 145453 124193 190593 151687 82749 101962 86243 19189 3075 115558 105337 1118 103126 142588 27916 90879 121731 88862 68325 93798 32535 47113 150020 103069 179 125065 61494 168294 142584 89605 24352 24791 159461 16...

output:

199998 199996 199993 199992 199991 199990 199989 199988 199981 199979 199978 199977 199975 199972 199969 199967 199964 199961 199959 199958 199957 199956 199955 199952 199949 199948 199947 199945 199944 199942 199939 199938 199935 199931 199928 199927 199926 199925 199923 199922 199920 199918 199917...

result:

ok 200000 numbers

Test #31:

score: 0
Accepted
time: 39ms
memory: 9428kb

input:

200000 200000
154495 70554 98100 49991 37179 160822 145444 118163 123307 71328 140975 177572 126375 145287 137046 58930 135025 49770 113981 122302 154454 65183 72926 53475 30959 69370 149806 4815 148723 84669 151489 22624 83822 151640 80049 50916 101996 172138 79378 92569 195375 59148 154738 154670 ...

output:

200000 199999 199998 199997 199996 199993 199992 199991 199990 199988 199986 199982 199980 199979 199975 199973 199971 199970 199968 199967 199966 199960 199958 199956 199953 199951 199948 199947 199945 199939 199938 199933 199931 199930 199925 199924 199923 199921 199920 199914 199913 199912 199911...

result:

ok 200000 numbers

Test #32:

score: 0
Accepted
time: 37ms
memory: 9356kb

input:

200000 200000
36160 12316 4617 171683 61036 187998 119733 102976 82223 114381 37910 197333 125253 178143 85673 143670 79441 26072 92672 199933 7865 30923 125680 16880 172307 18283 195300 65420 90281 87236 135875 153204 55770 136820 52681 77535 14710 195172 126158 74011 64488 77988 130387 170108 6201...

output:

200000 199999 199997 199993 199992 199990 199987 199985 199982 199981 199980 199978 199976 199975 199974 199973 199972 199971 199968 199966 199964 199963 199959 199957 199953 199952 199948 199947 199946 199942 199941 199935 199933 199930 199929 199928 199927 199926 199925 199923 199922 199921 199916...

result:

ok 200000 numbers

Test #33:

score: 0
Accepted
time: 40ms
memory: 9424kb

input:

200000 200000
142383 88115 165280 69875 66130 101922 83591 1093 5887 54340 183942 6347 57697 173490 131189 193990 69609 21174 47924 29399 21538 75067 15646 30499 39845 177841 195733 133327 25813 105524 86290 137480 108694 95470 75033 196852 60654 171027 22892 20079 192059 126222 100844 42622 62613 9...

output:

200000 199999 199998 199997 199996 199993 199991 199990 199989 199988 199986 199985 199983 199982 199981 199980 199979 199978 199977 199976 199975 199974 199973 199971 199967 199962 199959 199958 199957 199956 199953 199952 199951 199947 199946 199945 199943 199942 199939 199938 199935 199933 199930...

result:

ok 200000 numbers

Test #34:

score: 0
Accepted
time: 36ms
memory: 9416kb

input:

200000 200000
95235 154602 126 115107 10181 137596 76097 59657 155756 130836 182271 147937 97642 27804 92251 42997 43745 17489 188165 93696 37872 181520 113282 61858 57503 123086 109849 8180 109851 70032 72571 104034 101048 119563 116925 98948 90695 17025 34173 42904 40832 15357 19386 30601 71826 11...

output:

200000 199998 199994 199991 199988 199987 199986 199984 199982 199980 199978 199972 199971 199969 199968 199967 199965 199964 199962 199959 199958 199956 199955 199954 199953 199952 199949 199947 199945 199941 199940 199939 199937 199935 199932 199928 199927 199926 199925 199923 199922 199921 199920...

result:

ok 200000 numbers

Test #35:

score: 0
Accepted
time: 81ms
memory: 12868kb

input:

300000 300000
9253 267452 51027 263793 35312 290118 168274 258041 235821 73373 138162 291929 218385 26211 71101 216612 72547 218928 238160 148129 179440 143697 85453 219902 266424 148667 267577 226013 77397 298602 273005 103281 54814 244058 92935 273498 81077 117512 261501 189014 103227 267825 26263...

output:

210142 299998 299996 299993 18688 210311 299987 299986 299984 263943 3339 137257 95182 51184 153737 58415 78906 193151 116995 194399 282807 184173 171715 281897 299953 190111 31982 218684 42848 50241 251256 262401 299937 299935 162166 223646 299931 52327 299929 18197 289724 140974 299918 140945 2999...

result:

ok 300000 numbers

Test #36:

score: 0
Accepted
time: 89ms
memory: 12936kb

input:

300000 300000
227770 212919 67667 40495 168531 69540 171275 127554 274493 264535 5399 133828 228151 135056 234020 239502 62281 126641 34637 222586 207194 91831 173956 167250 118880 170528 189937 61009 203434 115982 201744 175218 170856 45464 217443 227378 18052 281843 156473 59750 170014 1027 98107 ...

output:

234357 154716 203245 124035 299996 176715 299993 13434 239263 74010 129881 44157 50115 89229 296748 40422 98283 20296 272438 65660 170119 175381 73415 299965 240216 182419 195067 299959 18588 299956 179194 43220 299949 226602 239253 248616 81193 5477 299940 216577 135040 55671 64573 299927 155983 29...

result:

ok 300000 numbers

Test #37:

score: 0
Accepted
time: 57ms
memory: 9100kb

input:

300000 300000
113750 11653 297873 27576 192547 152388 123141 291362 320 275960 39277 50060 142858 99284 63196 276861 14304 82166 253900 268364 57033 299585 279344 327 198574 202493 170938 109856 208278 22529 217147 8392 96434 233088 204363 295927 268104 87825 71340 136769 37975 265217 114558 156283 ...

output:

113750 28536 25443 60214 31926 279024 162286 154477 16046 243238 225942 50060 21500 14586 280157 172977 61263 82166 297223 135233 267207 166001 13322 193384 122750 214860 297637 215150 243328 192803 147180 8392 94967 25839 10755 295927 256201 87825 71340 20626 100695 10941 114558 147805 54371 221983...

result:

ok 300000 numbers

Test #38:

score: 0
Accepted
time: 57ms
memory: 9048kb

input:

300000 300000
157520 59915 182632 92129 287404 85876 65732 135758 232206 175218 122483 258204 72884 286834 128160 208401 268966 232831 156165 152648 155417 132574 72182 53227 145603 50957 191603 199902 132095 49895 53228 149065 236503 297120 70476 148381 36787 98195 157679 298399 242103 261390 14314...

output:

87062 197002 93824 229834 287404 100646 204367 151257 204481 270959 141247 66776 114535 174805 68435 255172 268966 271479 270305 211186 3614 79329 245674 85595 247102 67880 257945 33215 132095 156061 218903 160574 20542 23150 155896 176275 283493 98195 157679 207664 133717 277938 162777 287836 15472...

result:

ok 300000 numbers

Test #39:

score: 0
Accepted
time: 61ms
memory: 12888kb

input:

300000 300000
9500 87948 43564 111713 113627 284543 52989 68148 56134 240702 27215 130690 270663 122388 20941 47863 74109 3285 199400 181231 172831 108192 276403 135130 98336 144546 176044 95308 72904 288254 218142 196854 112033 85437 218936 292406 113776 22565 139521 19981 263403 116004 20855 21524...

output:

299999 299997 299991 299990 299989 299988 299987 299984 299982 299978 299977 299976 299974 299973 299971 299969 299968 299967 299966 299959 299957 299954 299952 299951 299949 299946 299945 299944 299943 299942 299941 299940 299938 299936 299934 299932 299930 299928 299927 299926 299925 299924 299923...

result:

ok 300000 numbers

Test #40:

score: 0
Accepted
time: 44ms
memory: 12932kb

input:

300000 300000
108016 222454 131085 49181 205231 86477 6396 163109 138962 171199 249907 49632 28259 110121 283595 113767 85944 192432 18198 9702 201298 66517 155633 46652 175046 174836 1818 96043 94832 247016 77773 131885 135390 165159 251692 201881 275445 227547 27137 83000 296301 277461 112204 2339...

output:

300000 299998 299996 299994 299993 299992 299990 299988 299986 299985 299984 299980 299979 299977 299974 299972 299970 299969 299964 299962 299959 299957 299956 299949 299945 299944 299943 299939 299938 299934 299932 299930 299929 299927 299922 299919 299918 299915 299914 299912 299909 299908 299905...

result:

ok 300000 numbers

Test #41:

score: 0
Accepted
time: 78ms
memory: 12856kb

input:

300000 300000
5370 155361 104499 15297 49348 202044 68573 194552 24688 105636 205933 295204 161324 269975 147107 250900 282564 43103 200517 95744 68863 292689 36591 285711 261558 170603 277055 159482 294733 240323 8475 242957 113432 238070 284581 215852 218952 257544 59372 174225 272676 116537 85850...

output:

299999 299997 299996 299994 299993 299992 299991 299988 299987 299986 299984 299980 299979 299977 299974 299973 299972 299970 299965 299962 299956 299955 299952 299951 299948 299946 299944 299942 299941 299940 299939 299938 299937 299931 299929 299928 299921 299919 299916 299915 299911 299909 299908...

result:

ok 300000 numbers

Test #42:

score: 0
Accepted
time: 63ms
memory: 12876kb

input:

300000 300000
98360 74395 193029 204253 222048 25613 191802 112050 291215 282136 204208 233215 73136 198018 69765 125629 97955 72035 231205 2698 206280 229242 72159 44456 279639 284328 37230 69734 35885 205803 153822 196737 224517 247171 247788 80743 120526 75415 93389 13454 279798 210371 186356 207...

output:

300000 299999 299998 299993 299992 299991 299990 299984 299983 299982 299981 299979 299978 299976 299973 299971 299969 299968 299967 299966 299965 299964 299961 299959 299958 299957 299955 299954 299953 299952 299949 299948 299947 299945 299943 299942 299941 299940 299939 299936 299931 299929 299927...

result:

ok 300000 numbers

Extra Test:

score: 0
Extra Test Passed