QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#486997#8258. Gift Exchangebashkort18 97ms17236kbC++204.0kb2024-07-22 15:02:122024-07-22 15:02:12

Judging History

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

  • [2024-07-22 15:02:12]
  • 评测
  • 测评结果:18
  • 用时:97ms
  • 内存:17236kb
  • [2024-07-22 15:02:12]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

constexpr int inf = 1e9 + 7;

struct SegmentTree {
    vector<int> t;
    int sz;

    void init(int m) {
        t.assign(2 * (sz = m), inf);
    }

    void rangeApply(int l, int r, int x) {
        for (l += sz, r += sz; l < r; l >>= 1, r >>= 1) {
            if (l & 1) {
                t[l] = min(t[l], x);
                l += 1;
            }
            if (r & 1) {
                r -= 1;
                t[r] = min(t[r], x);
            }
        }
    }

    int rangeMin(int l, int r) {
        int ans = inf;
        for (l += sz, r += sz; l < r; l >>= 1, r >>= 1) {
            if (l & 1) {
                ans = min(ans, t[l++]);
            }
            if (r & 1) {
                ans = min(ans, t[--r]);
            }
        }
        return ans;
    }

    int query(int x) {
        int ans = inf;
        for (ans = t[x += sz]; x >>= 1; ) {
            ans = min(ans, t[x]);
        }
        return ans;
    }

    void modify(int x, int f) {
        x += sz;
        t[x] = min(t[x], f);
        while (x >>= 1) {
            t[x] = min(t[x << 1], t[x << 1]);
        }
    }
};

template<typename T>
struct Fenwick {
    int n;
    vector<T> a;

    Fenwick() = default;

    explicit Fenwick(int n) : n(n), a(n + 1) {}

    void modify(int x, T v) {
        for (int i = x + 1; i <= n; i += i & -i) {
            a[i] += v;
        }
    }

    void modify(int l, int r, T v) {
        if (l >= r) return;
        modify(l, v), modify(r, -v);
    }

    T sum(int x) {
        T ans = 0;
        for (int i = x + 1; i > 0; i -= i & -i) {
            ans += a[i];
        }
        return ans;
    }

    T rangeSum(int l, int r) { //[l, r)
        if (l >= r) return 0;
        return sum(r - 1) - sum(l - 1);
    }

    int kth(T k) {
        int x = 0;
        for (int i = 1 << __lg(n); i; i >>= 1) {
            if (x + i <= n && k > a[x + i]) {
                x += i;
                k -= a[x];
            }
        }
        return x;
    }
};


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

    int n;
    cin >> n;

    vector<int> a(n), b(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        --a[i];
    }
    for (int i = 0; i < n; ++i) {
        cin >> b[i];
        --b[i];
    }

    vector<int> L(n, -1), R(n, n);
    for (int t = 0; t < 2; ++t) {
        SegmentTree tree, range;
        tree.init(2 * n), range.init(2 * n);
        vector<int> res(n, n);
        for (int i = n - 1; i >= 0; --i) {
            res[i] = min({res[i], tree.query(a[i]), tree.query(b[i]), range.rangeMin(b[i], a[i])});
            tree.rangeApply(b[i], a[i] + 1, i);
            range.modify(a[i], i);
            range.modify(b[i], i);
        }
        if (t == 0) {
            R = res;
        } else {
            L = res;
            reverse(L.begin(), L.end());
            for (int &x : L) {
                x = n - x - 1;
            }
        }
        reverse(a.begin(), a.end());
        reverse(b.begin(), b.end());
    }

    vector<vector<int>> updates(n + 1);
    for (int i = 0; i < n; ++i) {
        updates[R[i]].push_back(i);
    }

    int q;
    cin >> q;
    vector<vector<pair<int, int>>> queries(n);
    vector<int> answers(q);
    for (int i = 0; i < q; ++i) {
        int l, r;
        cin >> l >> r;
        queries[r - 1].push_back({l - 1, i});
    }

    Fenwick<int> fn(n);
    for (int i = 0; i < n; ++i) {
        if (L[i] >= 0) {
            fn.modify(L[i], 1);
        }
        for (int j : updates[i]) {
            if (L[j] >= 0) {
                fn.modify(L[j], -1);
            }
            fn.modify(j, 1);
        }
        for (auto [l, k] : queries[i]) {
            if (fn.rangeSum(l, i + 1) == i - l + 1) {
                answers[k] = true;
            }
        }
    }

    for (int i = 0; i < q; ++i) {
        cout << (answers[i] ? "Yes\n" : "No\n");
    }

    return 0;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 4
Accepted
time: 0ms
memory: 3492kb

input:

10
13 14 16 18 17 19 20 8 6 4
7 12 15 2 11 10 9 3 5 1
10
2 3
1 6
1 7
5 8
1 10
2 6
5 10
3 6
3 7
4 7

output:

No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes

result:

ok 10 token(s): yes count is 8, no count is 2

Test #2:

score: 0
Wrong Answer
time: 0ms
memory: 3564kb

input:

10
12 19 15 20 14 9 4 13 17 16
11 18 7 5 10 8 3 1 2 6
10
6 10
2 6
6 7
3 8
1 8
7 8
6 8
4 5
1 7
4 5

output:

Yes
Yes
No
Yes
Yes
No
No
No
No
No

result:

wrong answer expected YES, found NO [6th token]

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 10
Accepted

Test #30:

score: 10
Accepted
time: 70ms
memory: 11892kb

input:

100000
200000 87337 190412 58171 10676 178924 155670 153538 106523 166320 196463 174807 19706 66971 196345 114283 119288 59218 155349 194059 154822 98022 199346 153510 145408 187388 174214 150932 65211 35112 20551 176504 139581 41024 52730 150416 18789 190510 108780 47812 169962 158959 135239 191992...

output:

Yes

result:

ok YES

Test #31:

score: 10
Accepted
time: 79ms
memory: 11960kb

input:

99996
199992 55108 192122 156535 96703 158022 98612 154080 174501 80333 191718 138961 171355 154101 62771 14226 197265 155606 29245 170843 138895 82846 166147 165740 146215 131388 86029 172891 136364 149984 101524 192965 86471 145997 174545 141753 76373 143913 197383 78031 92038 142017 128688 134591...

output:

Yes

result:

ok YES

Test #32:

score: 10
Accepted
time: 97ms
memory: 11776kb

input:

99999
199997 170879 161773 28645 163801 191566 171319 165453 53288 132456 157500 91941 146443 170074 93531 161983 19502 64479 129891 144995 171001 161313 193878 181848 137588 99441 195737 143467 111802 194680 190788 115429 120877 169533 140028 197536 31383 148612 118644 93306 188532 134687 93192 735...

output:

Yes

result:

ok YES

Test #33:

score: 10
Accepted
time: 71ms
memory: 11828kb

input:

99998
199995 171377 133250 170806 197343 162890 176641 198229 156952 106802 148078 134198 38360 182569 58669 116012 120742 177680 93529 99582 123704 150105 171634 107951 125500 163732 179649 88588 39234 198625 121214 176445 63415 179868 187758 171381 182891 158588 157548 88592 171267 76505 73211 320...

output:

Yes

result:

ok YES

Test #34:

score: 10
Accepted
time: 75ms
memory: 11872kb

input:

99994
199986 176184 128449 165655 180411 108099 175456 183507 96091 70117 144956 115377 154518 160497 55545 181168 131848 118193 156102 182500 168439 63241 171910 127138 197292 163655 42841 94923 164742 143990 146191 166736 107846 141059 183167 82715 147429 71721 89024 132050 176003 157826 80392 158...

output:

Yes

result:

ok YES

Test #35:

score: 10
Accepted
time: 69ms
memory: 11872kb

input:

99992
199982 94622 159310 166234 105469 44414 52091 123694 172916 179711 149323 115375 166040 92513 67125 146185 197622 76337 98286 145089 106898 45508 188859 181520 186912 62260 77767 114546 103202 139705 181802 79604 153783 143459 173771 53329 161991 122820 59148 175497 171100 191733 170006 112486...

output:

Yes

result:

ok YES

Test #36:

score: 10
Accepted
time: 77ms
memory: 11784kb

input:

99994
199986 172588 101761 173680 154796 47906 165246 155807 142583 82053 124298 185751 146473 152843 53592 189568 141547 56758 179491 145227 199189 152477 77578 119916 185291 113298 199873 172624 155978 67770 48535 89031 186445 190000 86320 101939 89859 95948 119667 111209 45026 105189 107948 49321...

output:

No

result:

ok NO

Test #37:

score: 10
Accepted
time: 71ms
memory: 11936kb

input:

99992
199982 109852 155026 157923 110059 91615 184436 197597 189940 165799 197946 168174 61274 182820 197704 185711 79614 179286 55824 153991 71910 157841 175794 134500 29170 66409 76993 183438 161616 88974 76217 121790 147837 134276 136205 106385 89486 107495 102229 187620 174748 76130 75940 194935...

output:

No

result:

ok NO

Test #38:

score: 10
Accepted
time: 70ms
memory: 11792kb

input:

100000
199999 74639 195073 197398 179979 168474 145783 79979 159184 131687 174609 183930 160341 68420 127730 176972 164251 182791 133617 83641 167951 133542 35978 163253 187454 122787 187615 85608 79476 125951 114704 188425 93638 120054 192421 174834 106180 42561 71789 170972 180724 95208 199400 117...

output:

Yes

result:

ok YES

Subtask #4:

score: 0
Wrong Answer

Test #39:

score: 31
Accepted
time: 54ms
memory: 9544kb

input:

74998
147369 94378 68913 123990 65257 88482 116281 130255 78568 141536 99818 113372 26849 44703 95080 48018 147366 120676 91071 19208 101933 124465 78741 140833 90216 52837 145872 105601 142557 113425 86814 84542 101123 108992 78297 100014 104368 69638 40964 118227 76398 117479 115743 72849 102952 1...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes

result:

ok 10 token(s): yes count is 10, no count is 0

Test #40:

score: 31
Accepted
time: 73ms
memory: 11752kb

input:

100000
170854 85803 190478 195356 68149 101079 160091 179386 130394 139476 179555 126978 167547 72065 161727 131638 174824 164983 186730 137165 199164 176656 182858 115220 171372 182351 157236 123780 62649 186367 133008 181264 148394 194183 128269 58610 118326 47996 183674 131477 91894 76140 154928 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes

result:

ok 10 token(s): yes count is 10, no count is 0

Test #41:

score: 31
Accepted
time: 51ms
memory: 9256kb

input:

72263
130381 105716 139143 33477 86587 120207 73233 38155 92520 125495 23580 69974 121855 74665 137812 18565 132361 95705 128027 144100 124410 59047 128296 55909 122780 117585 50625 136320 49469 99327 72567 114712 39178 85774 98604 91033 96296 129069 106417 137597 55731 103597 92014 133512 101043 10...

output:

Yes
Yes
Yes
No
No
No
No
Yes
Yes
No

result:

ok 10 token(s): yes count is 5, no count is 5

Test #42:

score: 31
Accepted
time: 78ms
memory: 11704kb

input:

100000
126626 150000 164533 93954 84178 127720 196307 191298 197000 58182 74847 177055 162414 81634 197421 66855 75160 114529 152612 39251 195125 173835 185089 111782 87465 123997 67067 47121 108359 155858 183706 177604 157701 150153 132993 179460 130275 74441 147142 158401 175469 194555 174393 1407...

output:

Yes
No
No
Yes
No
Yes
No
No
Yes
Yes

result:

ok 10 token(s): yes count is 5, no count is 5

Test #43:

score: 31
Accepted
time: 47ms
memory: 10416kb

input:

98148
12647 155973 20767 36805 168027 146372 113253 66852 57625 1895 12580 165096 49832 70925 51643 104757 37054 65869 192814 19113 33302 2095 107427 178717 180641 23141 25274 164150 81130 106741 49558 145423 35903 177929 194630 68466 115774 120908 107796 114055 18798 78402 188605 138386 106234 5350...

output:

Yes
No
No
Yes
No
No
No
No
No
No

result:

ok 10 token(s): yes count is 2, no count is 8

Test #44:

score: 31
Accepted
time: 45ms
memory: 10456kb

input:

100000
10705 194107 21546 73701 152844 24382 42696 113958 60425 157337 37450 71952 62746 111551 19905 160604 108607 112452 11252 38865 119652 144352 121417 134813 133291 136001 199480 196487 185112 105850 198182 167163 17348 115046 28792 99322 28320 73922 133873 46997 31716 155771 165925 157474 311 ...

output:

Yes
No
No
No
Yes
No
Yes
Yes
Yes
Yes

result:

ok 10 token(s): yes count is 6, no count is 4

Test #45:

score: 31
Accepted
time: 28ms
memory: 8936kb

input:

74884
106721 73638 67742 96410 111958 112231 35979 93104 109910 105533 125985 31820 90312 4917 46772 87091 16222 49834 38316 93439 42894 370 140805 105063 73687 4903 70500 147126 118714 75867 53811 137670 116357 131869 87300 100714 50125 48637 12083 6759 25059 11873 127244 80583 30114 98073 36066 58...

output:

No
No
No
No
No
No
No
No
No
No

result:

ok 10 token(s): yes count is 0, no count is 10

Test #46:

score: 0
Wrong Answer
time: 45ms
memory: 10668kb

input:

100000
194884 180232 99694 108507 186527 179325 154704 107083 14761 84155 140296 122106 99807 153759 3855 115584 187176 135737 105877 181408 9860 197000 84071 29406 37504 61026 56016 124009 147261 93231 123279 144432 10668 163135 75226 99713 189311 178949 118610 82204 184588 112542 56956 141800 7422...

output:

Yes
No
No
No
No
No
No
No
No
No

result:

wrong answer expected YES, found NO [9th token]

Subtask #5:

score: 8
Accepted

Test #52:

score: 8
Accepted
time: 67ms
memory: 13980kb

input:

71726
4 5 7 10 11 17 20 24 26 27 28 29 31 35 36 38 40 42 44 46 48 50 51 52 55 56 57 59 61 62 66 68 69 70 72 73 75 78 79 83 85 86 91 93 96 97 98 100 105 107 108 109 110 111 112 113 116 117 120 124 125 126 127 129 132 133 135 139 144 145 146 148 149 152 153 154 156 157 159 161 163 165 167 173 174 178 ...

output:

Yes
Yes
No
No
Yes
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
Yes
No
No
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
No
Yes
No
Yes
Yes
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No
Yes
No
...

result:

ok 200000 token(s): yes count is 62654, no count is 137346

Test #53:

score: 8
Accepted
time: 69ms
memory: 17080kb

input:

100000
3 7 9 14 18 20 21 22 27 28 29 32 36 38 39 44 45 47 48 49 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 75 76 77 79 81 83 85 87 89 91 93 94 97 100 102 104 106 107 110 113 114 116 120 122 123 124 125 130 131 135 136 139 141 143 144 145 146 147 148 152 154 155 157 160 161 163 166 168 170 173 178 ...

output:

No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
Yes
No
No
Yes
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
Yes
No
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
No
...

result:

ok 200000 token(s): yes count is 35784, no count is 164216

Test #54:

score: 8
Accepted
time: 67ms
memory: 14972kb

input:

81198
4 6 8 10 12 13 16 18 19 21 25 26 27 30 33 34 36 37 39 44 46 48 51 53 54 56 57 59 63 66 68 73 76 78 79 80 82 83 87 88 90 91 92 93 94 96 101 104 108 110 114 115 118 122 123 124 126 127 131 134 137 141 142 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 164 166 170 174 175 176...

output:

No
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
Yes
No
No
No
No
No
...

result:

ok 200000 token(s): yes count is 18319, no count is 181681

Test #55:

score: 8
Accepted
time: 70ms
memory: 17160kb

input:

100000
3 8 10 13 14 16 20 21 27 28 29 33 37 39 42 44 45 46 48 49 50 51 54 56 58 59 61 62 63 68 69 70 71 72 73 74 75 76 82 84 87 90 93 96 97 101 106 107 110 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 135 136 138 141 143 147 152 153 154 159 160 162 166 167 168 174 175 176 181 ...

output:

No
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
N...

result:

ok 200000 token(s): yes count is 11911, no count is 188089

Test #56:

score: 8
Accepted
time: 66ms
memory: 15856kb

input:

89662
4 6 7 12 13 14 15 17 22 23 24 25 27 29 32 33 37 38 39 41 45 47 50 52 53 54 55 57 59 62 66 67 68 71 73 74 76 79 80 81 84 86 87 90 93 94 96 103 105 106 107 111 112 113 116 119 120 121 122 124 125 126 130 133 135 136 137 138 139 141 143 146 148 149 152 153 155 158 160 161 163 165 168 171 172 177 ...

output:

No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
N...

result:

ok 200000 token(s): yes count is 7411, no count is 192589

Test #57:

score: 8
Accepted
time: 73ms
memory: 17236kb

input:

100000
3 5 7 9 11 14 17 19 20 23 24 26 27 30 36 38 41 42 43 46 47 50 51 53 54 55 56 57 58 61 63 65 69 70 71 72 75 77 81 83 84 85 87 92 93 96 97 98 100 101 105 106 107 110 111 113 114 117 119 122 124 125 128 129 132 133 135 141 142 143 147 149 150 152 153 154 155 156 159 161 162 165 168 169 175 176 1...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No...

result:

ok 200000 token(s): yes count is 5171, no count is 194829

Test #58:

score: 8
Accepted
time: 43ms
memory: 16296kb

input:

100000
3 7 8 9 13 18 20 22 24 25 31 34 37 39 40 41 43 46 47 48 51 53 55 56 58 59 61 63 65 67 68 70 71 72 73 74 75 76 79 81 83 87 94 96 101 102 106 107 108 109 112 116 117 120 122 124 126 127 129 132 133 135 138 142 144 150 156 157 159 161 162 163 166 167 168 169 170 172 173 175 176 179 180 181 182 1...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
...

result:

ok 200000 token(s): yes count is 0, no count is 200000

Test #59:

score: 8
Accepted
time: 51ms
memory: 16168kb

input:

100000
3 6 7 11 14 15 18 23 24 25 26 27 29 32 34 38 44 47 48 49 50 51 52 55 57 61 62 64 65 66 67 68 69 71 73 75 77 78 79 81 83 85 92 93 94 96 100 101 102 103 106 109 112 115 116 117 121 122 124 125 126 132 133 138 140 149 150 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 17...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
...

result:

ok 200000 token(s): yes count is 0, no count is 200000

Test #60:

score: 8
Accepted
time: 92ms
memory: 17104kb

input:

100000
100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040 100041 100042...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 200000 token(s): yes count is 200000, no count is 0

Test #61:

score: 8
Accepted
time: 61ms
memory: 16328kb

input:

100000
3 5 7 9 11 14 16 17 19 21 23 25 27 29 36 37 39 40 41 42 44 47 51 52 55 56 57 59 62 64 65 66 68 71 72 73 75 78 79 81 83 85 88 92 93 95 97 98 99 103 104 105 108 110 111 113 115 121 125 127 129 133 134 136 139 140 143 144 145 146 147 151 152 153 154 155 156 157 158 161 164 169 170 171 174 177 17...

output:

No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No...

result:

ok 200000 token(s): yes count is 6590, no count is 193410

Test #62:

score: 8
Accepted
time: 54ms
memory: 16272kb

input:

100000
5 8 9 10 13 14 15 17 20 22 23 25 27 30 31 32 35 36 40 41 43 50 51 52 56 57 60 62 63 67 69 71 72 73 75 77 79 80 82 84 85 86 87 91 94 96 98 100 104 106 107 108 111 112 113 116 118 119 123 126 128 129 130 131 132 137 147 151 152 153 158 160 161 163 165 166 169 170 171 172 175 176 178 180 182 184...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No...

result:

ok 200000 token(s): yes count is 6936, no count is 193064

Subtask #6:

score: 0
Wrong Answer

Dependency #5:

100%
Accepted

Test #63:

score: 0
Wrong Answer
time: 88ms
memory: 15384kb

input:

82281
1042 1077 1434 1646 1653 1686 1695 1709 1890 1994 2024 2035 2062 2072 2124 2212 2220 2235 2333 2419 2520 2659 2770 3038 3060 3077 3181 3204 3207 3279 3285 3347 3361 3386 3398 3401 3449 3498 3665 3774 3873 3888 3892 3923 4006 4008 4020 4079 4121 4193 4196 4226 4283 4304 4327 4357 4420 4422 4467...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

wrong answer expected YES, found NO [43641st token]

Subtask #7:

score: 0
Skipped

Dependency #1:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

0%