QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#68261#2760. SimurghLenstar30 493ms13028kbC++145.7kb2022-12-15 15:37:062022-12-15 15:37:07

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-12-15 15:37:07]
  • 评测
  • 测评结果:30
  • 用时:493ms
  • 内存:13028kb
  • [2022-12-15 15:37:06]
  • 提交

answer

#include <bits/stdc++.h>
#include "simurgh.h"

using pii = std::pair<int, int>;
#define mkp(a, b) std::make_pair(a, b)

const int N = 5e2 + 10, M = N * N;

std::vector<int> Gold_Roads, Spanning_Tree;
int tot = 1, fir[N], nex[M], got[M], idx[M], Map[N][N], n;

inline void AddEdge(int u, int v, int I) {
    nex[++tot] = fir[u], fir[u] = tot, got[tot] = v, idx[tot] = I;
    nex[++tot] = fir[v], fir[v] = tot, got[tot] = u, idx[tot] = I;
}

int par[N], vis[M], dep[N], Vis[M], par_edge[N], TYPE[M], w[N], f[N], U[M], V[M], d[N];

inline void dfs(int u) {
    vis[u] = true;

    for (int i = fir[u]; i; i = nex[i])
        if (!vis[got[i]])
            Spanning_Tree.push_back(idx[i]), dfs(got[i]);
}

inline int find(int u) {
    return f[u] == u ? u : f[u] = find(f[u]);
}

inline int count(std::vector<int> E) {
    if (E.size() == n - 1)
        return count_common_roads(E);

    // assert(E.size() < n);
    int s = 0, sum = 0;

    for (int i = 0; i < n; ++i)
        f[i] = i;

    for (int i = 0; i < E.size(); ++i) {
        int u = U[E[i]], v = V[E[i]];
        // assert(find(u) != find(v));
        f[find(u)] = find(v);
    }

    // printf("E.size() = %d\n", E.size());
    // for (int i = 0; i < n; ++i) if (find(i) == i) ++sum;
    // printf("%d\n", sum);
    for (auto i : Spanning_Tree) {
        int u = find(U[i]), v = find(V[i]);

        if (u != v)
            f[u] = v, s += TYPE[i], E.push_back(i);
    }

    // assert(E.size() < n);
    return count_common_roads(E) - s;
}

inline std::vector<int> ring(std::vector<int> bas, int ban) {
    std::vector<int> res;

    for (auto dat : bas)
        if (dat != ban)
            res.push_back(dat);

    return res;
}

inline void solve(int u, int v, int edg_num) {
    int flg = 0, edg = 0;
    std::vector<int> query;
    memset(Vis, 0, sizeof(Vis));

    for (int U = u; U != v; U = par[U]) {
        Vis[par_edge[U]] = true;

        if (TYPE[par_edge[U]] != -1)
            flg = true, edg = par_edge[U];
    }

    if (flg) {
        std::vector<int> bas = Spanning_Tree;
        bas.push_back(edg_num);
        int sum = count(ring(bas, edg));

        for (int U = u; U != v; U = par[U]) {
            int e = par_edge[U];

            if (TYPE[e] == -1) {
                std::vector<int> query = ring(bas, e);
                int s = count(query);
                TYPE[e] = -TYPE[edg] + s - sum;
            }
        }
    } else {
        std::vector<int> bas = Spanning_Tree;
        int Min = count(bas), flg = true;

        for (int U = u; U != v; U = par[U]) {
            int e = par_edge[U];
            std::vector<int> query = ring(bas, e);
            query.push_back(edg_num);
            w[U] = count(query), flg &= w[U] == Min, Min = std::min(Min, w[U]);
        }

        for (int U = u; U != v; U = par[U])
            TYPE[par_edge[U]] = flg ? 0 : 1 - w[U] + Min;
    }

    // for (int i = 0; i < 6; ++i) printf("%d ", TYPE[i]); puts("");
}

inline void dfs(int u, int fa) {
    par[u] = fa, vis[u] = true, dep[u] = dep[fa] + 1;

    for (int i = fir[u]; i; i = nex[i])
        if (got[i] != fa) {
            if (!vis[got[i]])
                par_edge[got[i]] = idx[i], dfs(got[i], u);
            else if (dep[u] > dep[got[i]])
                solve(u, got[i], idx[i]);
        }
}

inline int solve(int u, std::vector<int> vec) {
    if (vec.size() == 1)
        return vec[0];

    int mid = vec.size() / 2;
    std::vector<int> E;

    for (int i = 0; i < mid; ++i)
        E.push_back(Map[u][vec[i]]);

    if (count(E)) {
        std::vector<int> v;

        for (int i = 0; i < mid; ++i)
            v.push_back(vec[i]);

        return solve(u, v);
    } else {
        std::vector<int> v;

        for (int i = mid; i < vec.size(); ++i)
            v.push_back(vec[i]);

        return solve(u, v);
    }
}

inline int solve(int u) {
    std::vector<int> vec;

    for (int i = fir[u]; i; i = nex[i])
        if (TYPE[idx[i]] == -1)
            vec.push_back(got[i]);

    return solve(u, vec);
}

std::vector<int> find_roads(int N, std::vector<int> U, std::vector<int> V) {
    // freopen("3173.out", "w", stdout);
    int m = U.size();
    n = N;

    for (int i = 0; i < m; ++i) {
        int u = U[i], v = V[i];
        AddEdge(u, v, i);
        Map[u][v] = Map[v][u] = i;
        ::U[i] = u, ::V[i] = v;
    }

    memset(TYPE, -1, sizeof(TYPE));
    dfs(0), memset(vis, 0, sizeof(vis)), dfs(0, -1);

    for (auto i : Spanning_Tree)
        if (TYPE[i] == -1)
            TYPE[i] = 1;

    // for (int i = 0; i < m; ++i) printf("%d ", TYPE[i]); puts("");
    // for (int i = 0; i < n; ++i) printf("%d ", par[i]); puts("");
    // std::cout << "Spanning_Tree.size() = " << Spanning_Tree.size() << std::endl;
    // for (int i: Spanning_Tree) printf("%d %d %d\n", U[i], V[i], TYPE[i]);
    // for (int i: Spanning_Tree) if (lxndanfdiadsfnslkjGrader::Gold[i] != TYPE[i])
    // std::cerr << U[i] << ' ' << V[i] << ' ' << i << std::endl;
    // return Spanning_Tree;
    for (int u = 0; u < n; ++u) {
        std::vector<int> E;

        for (int i = fir[u]; i; i = nex[i])
            E.push_back(idx[i]);

        d[u] = count(E);
    }

    for (auto i : Spanning_Tree)
        if (TYPE[i] == 1) {
            Gold_Roads.push_back(i), --d[U[i]], --d[V[i]];
        }

    for (int i = 0; i < n - 1; ++i) {
        for (int u = 0; u < n; ++u)
            if (d[u]) {
                int v = solve(u);
                Gold_Roads.push_back(Map[u][v]), --d[u], --d[v];
                TYPE[Map[u][v]] = 1;
                break;
            }
    }

    // fclose(stdout);
    return Gold_Roads;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 13
Accepted

Test #1:

score: 13
Accepted
time: 1ms
memory: 11744kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 21 30000
2 0
0 1
5 2
2 6
1 3
3 0
6 0
4 5
3 2
4 0
1 4
0 5
4 3
4 6
6 1
2 1
5 3
2 4
5 6
5 1
6 3
7 10 9 13 12 17

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
17 13 9 10 12 7

result:

ok correct

Test #2:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 21 30000
4 6
1 6
2 3
0 3
2 1
2 6
5 6
6 3
0 2
1 0
4 2
1 3
5 2
5 0
0 6
5 3
4 5
5 1
3 4
1 4
4 0
4 16 10 0 20 18

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
20 4 10 18 16 0

result:

ok correct

Test #3:

score: 0
Accepted
time: 2ms
memory: 9768kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 21 30000
2 5
0 4
4 5
4 3
5 3
1 3
3 6
4 1
6 0
5 6
6 2
6 1
6 4
3 2
2 1
1 0
0 2
5 0
5 1
4 2
0 3
20 17 15 9 2 19

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
20 19 17 15 2 9

result:

ok correct

Test #4:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 13 30000
2 4
4 3
3 2
0 3
0 4
6 3
6 1
4 5
6 2
1 3
5 6
6 0
6 4
3 9 12 7 0 4

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
12 7 9 4 3 0

result:

ok correct

Test #5:

score: 0
Accepted
time: 2ms
memory: 9620kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
6 10 30000
5 2
0 1
1 2
0 3
3 2
1 4
0 5
3 5
4 3
1 3
5 0 7 2 1

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
7 5 2 1 0

result:

ok correct

Test #6:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 16 30000
3 4
2 5
2 1
0 5
1 5
0 2
2 6
6 1
4 6
0 1
2 3
6 3
3 1
1 4
4 5
3 5
0 9 5 15 3 11

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
9 15 11 5 3 0

result:

ok correct

Test #7:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
2 1 30000
0 1
0

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
0

result:

ok correct

Test #8:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
3 3 30000
0 1
2 0
1 2
2 0

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
2 0

result:

ok correct

Test #9:

score: 0
Accepted
time: 2ms
memory: 9696kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
6 5 30000
2 4
5 4
4 0
4 1
3 4
3 1 4 0 2

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
2 4 3 1 0

result:

ok correct

Test #10:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
6 14 30000
4 2
1 3
4 5
4 1
0 4
0 1
2 3
2 1
0 3
5 3
0 5
0 2
5 2
1 5
13 8 10 7 3

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
13 3 10 8 7

result:

ok correct

Test #11:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 6 30000
3 0
3 5
4 0
5 6
0 2
1 3
3 4 1 5 0 2

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
4 2 0 5 1 3

result:

ok correct

Test #12:

score: 0
Accepted
time: 2ms
memory: 11924kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
6 15 30000
4 3
2 3
3 5
2 0
5 2
1 3
1 4
0 5
3 0
4 0
1 0
2 1
4 5
4 2
5 1
9 13 12 6 0

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
12 13 9 6 0

result:

ok correct

Test #13:

score: 0
Accepted
time: 2ms
memory: 11792kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
7 21 30000
0 2
2 5
3 4
0 3
5 4
4 2
2 1
4 6
5 3
0 1
4 0
1 6
3 6
1 3
1 5
5 0
0 6
4 1
6 5
3 2
2 6
16 3 18 17 4 6

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
16 17 4 3 6 18

result:

ok correct

Subtask #2:

score: 17
Accepted

Dependency #1:

100%
Accepted

Test #14:

score: 17
Accepted
time: 50ms
memory: 11884kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 1225 30000
47 4
24 48
42 13
5 42
19 17
29 31
23 48
37 25
37 43
27 22
43 30
19 44
49 37
39 14
26 46
46 35
49 15
40 19
6 31
37 1
21 0
26 45
6 4
38 36
6 8
20 4
18 24
20 35
5 29
1 19
35 49
29 20
25 10
10 36
2 22
26 11
7 9
24 3
35 38
48 41
22...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
1199 923 706 503 497 397 638 851 478 333 277 195 1033 754 679 1071 24 221 760 746 509 166 257 440 119 355 212 61 1006 848 795 591 552 866 377 458 1042 770 584 299 1107 768 127 62 860 1058 1205 322 880

result:

ok correct

Test #15:

score: 0
Accepted
time: 50ms
memory: 9808kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 1225 30000
44 29
11 44
39 16
20 31
6 3
9 27
49 27
12 0
27 1
48 49
46 12
35 36
35 11
49 13
23 20
28 26
12 1
42 37
5 15
28 32
6 10
16 7
4 43
4 31
49 34
9 14
2 46
44 30
40 17
14 29
41 18
27 44
13 3
23 40
47 24
16 3
6 26
45 18
24 42
11 10
23...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
1055 913 501 181 354 95 577 275 48 1185 1173 1051 1037 933 849 776 769 723 701 678 649 633 607 600 562 552 497 496 472 456 420 315 297 294 280 279 256 230 228 204 196 182 178 151 97 89 88 67 21

result:

ok correct

Test #16:

score: 0
Accepted
time: 48ms
memory: 9812kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 1225 30000
12 30
6 44
33 47
7 33
0 2
10 30
30 46
14 11
43 42
13 27
49 24
6 17
21 2
12 21
24 38
5 21
17 0
16 4
26 5
27 32
20 45
6 20
19 0
20 35
47 39
17 39
0 23
26 33
1 17
3 20
4 46
48 21
21 35
24 40
9 29
28 23
9 1
43 34
4 44
18 37
40 13
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
1068 795 790 95 859 841 847 470 261 56 874 1075 948 997 198 524 273 882 25 166 907 834 213 204 917 290 1048 438 150 885 482 93 160 67 1064 1082 466 894 513 1141 966 784 610 535 382 374 326 222 24

result:

ok correct

Test #17:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 1002 30000
35 6
20 23
17 3
16 48
49 29
31 32
38 3
10 39
16 4
47 13
0 19
24 25
42 39
48 44
39 32
1 42
18 8
17 15
19 32
33 23
21 18
7 13
6 0
26 35
34 22
39 13
48 47
6 21
44 7
21 13
43 16
41 43
36 6
25 14
3 49
3 33
47 29
25 45
45 13
12 13
3...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
823 963 801 348 858 837 174 614 237 670 213 313 783 420 402 28 560 357 90 841 372 636 96 941 898 370 308 116 685 221 559 668 229 135 20 808 591 828 436 401 351 112 4 875 266 712 440 403 304

result:

ok correct

Test #18:

score: 0
Accepted
time: 12ms
memory: 9772kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 371 30000
20 0
5 9
13 38
4 3
12 23
20 42
43 12
27 28
1 42
23 42
14 41
39 9
2 9
10 13
14 32
18 30
6 7
32 3
39 38
12 34
33 0
10 41
32 30
15 43
13 6
2 30
20 14
36 21
17 2
0 28
24 29
19 7
25 15
10 48
21 49
31 7
2 44
7 44
28 40
38 17
33 48
18...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
344 349 290 210 314 105 0 364 257 74 62 193 121 45 135 24 16 300 35 239 131 101 46 89 224 152 139 21 102 238 14 277 237 212 129 234 156 82 27 233 294 140 93 309 38 279 216 18 274

result:

ok correct

Test #19:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 1027 30000
46 5
15 29
43 39
16 32
38 5
4 22
13 4
41 5
0 41
39 6
6 8
3 13
25 6
40 25
17 40
47 0
26 15
30 11
27 31
43 45
30 17
35 37
8 27
2 38
35 19
7 12
36 31
41 21
14 25
14 35
15 17
37 2
27 46
24 39
24 29
19 10
28 1
22 35
24 41
16 46
13 ...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
1005 1001 994 983 986 142 77 885 31 506 173 220 5 313 607 497 398 645 583 417 230 158 488 83 988 406 198 170 928 521 487 148 816 1007 140 674 839 112 85 13 974 585 670 238 639 660 196 571 1021

result:

ok correct

Test #20:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 965 30000
28 25
38 23
12 44
1 35
45 46
39 4
19 22
40 23
25 49
20 29
30 9
17 2
15 32
32 14
45 7
19 12
40 22
12 35
10 5
49 37
29 31
19 40
22 6
28 46
23 11
2 1
40 24
14 44
44 40
16 47
7 14
38 47
43 34
4 18
17 22
32 30
33 13
36 21
47 37
37 3...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
841 820 952 907 846 799 766 673 541 353 259 213 182 50 837 138 335 93 911 901 570 352 273 257 161 157 74 48 508 114 127 796 679 544 505 371 125 109 546 6 346 698 551 332 251 146 79 45 16

result:

ok correct

Test #21:

score: 0
Accepted
time: 35ms
memory: 9804kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 900 30000
25 47
5 46
35 22
46 22
15 35
37 46
27 46
29 20
0 7
7 14
8 19
28 38
11 7
9 16
28 0
38 29
30 47
23 11
26 10
3 38
30 49
28 13
45 3
7 17
42 0
30 1
48 2
47 22
18 49
26 34
12 20
40 9
12 38
46 16
24 16
40 30
31 33
45 34
16 25
14 31
4 ...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
897 870 78 404 288 575 40 291 816 645 551 428 300 805 745 763 751 323 65 32 524 605 704 877 566 703 590 561 27 430 360 699 433 557 727 653 530 498 423 533 252 502 256 196 46 351 487 298 211

result:

ok correct

Test #22:

score: 0
Accepted
time: 25ms
memory: 11828kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 701 30000
1 47
37 0
2 41
32 33
15 40
38 42
5 27
0 9
0 8
10 36
26 42
5 25
41 35
27 2
21 15
40 28
0 15
43 29
37 3
28 18
9 3
47 27
32 38
48 47
28 13
34 32
27 23
40 8
38 15
46 7
24 14
12 46
47 28
20 43
2 48
2 28
22 45
14 27
23 42
30 35
26 18...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
477 16 8 7 1 46 0 13 2 18 11 6 51 70 57 29 42 9 60 86 61 31 24 37 30 56 28 14 4 84 19 76 33 36 26 62 10 21 32 15 17 39 25 22 3 12 5 55 23

result:

ok correct

Test #23:

score: 0
Accepted
time: 25ms
memory: 9796kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 626 30000
49 25
30 31
0 3
6 11
25 10
19 13
10 49
43 31
7 19
24 28
39 31
15 7
32 30
27 41
18 23
31 13
26 40
19 41
42 30
47 28
5 4
41 24
42 27
15 45
29 14
29 37
42 6
2 42
45 13
27 32
32 20
4 29
4 21
20 24
16 44
14 12
28 6
25 37
10 22
8 48
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
66 77 2 56 27 46 32 31 20 26 3 11 8 39 38 4 41 35 15 5 24 23 51 49 34 97 91 43 14 17 30 47 52 21 9 37 0 16 13 19 25 18 12 1 10 7 61 54 44

result:

ok correct

Test #24:

score: 0
Accepted
time: 25ms
memory: 9912kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 601 30000
28 10
43 16
22 35
42 20
8 39
34 33
47 44
47 49
3 9
10 32
34 5
4 14
9 18
19 33
29 38
31 25
8 2
5 4
5 8
40 23
27 21
36 23
10 6
14 26
39 27
44 36
29 47
6 1
2 46
21 15
43 13
28 38
1 23
41 45
3 49
26 15
39 2
11 17
22 0
45 47
48 46
4...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
130 38 27 28 16 34 8 17 11 18 10 22 60 44 4 12 65 9 0 37 49 30 23 50 29 1 56 13 52 3 70 20 2 21 19 47 15 24 59 31 26 14 5 25 33 6 39 40 7

result:

ok correct

Test #25:

score: 0
Accepted
time: 5ms
memory: 9780kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 85 30000
33 16
22 4
21 25
32 42
13 46
7 38
18 16
38 33
44 27
19 2
3 2
30 24
0 47
49 12
20 47
17 32
23 26
45 28
35 8
31 20
40 34
25 36
25 43
5 40
11 46
24 1
49 35
30 9
17 41
33 29
11 13
28 19
9 32
6 48
11 39
15 23
16 29
31 0
6 38
27 4
3 0...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
19 41 25 46 26 32 69 8 1 16 61 23 84 82 24 52 38 7 22 40 31 17 70 12 10 9 39 47 33 5 18 27 34 13 4 35 6 0 28 15 14 2 44 11 21 45 29 3 20

result:

ok correct

Test #26:

score: 0
Accepted
time: 21ms
memory: 11812kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 602 30000
23 30
14 19
2 28
37 21
18 35
1 24
35 1
2 7
11 14
41 11
15 30
6 47
16 25
27 21
14 31
26 30
36 14
43 8
47 7
1 15
18 14
38 31
16 10
19 45
49 27
40 4
25 13
31 3
43 26
19 39
47 27
30 1
2 27
34 33
43 36
45 18
4 37
39 23
11 17
37 44
2...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
56 51 19 6 5 44 7 2 27 36 25 75 42 11 18 17 71 41 22 38 9 8 218 26 20 16 14 1 10 12 4 45 29 23 40 13 3 0 47 28 15 30 24 67 96 21 33 93 39

result:

ok correct

Test #27:

score: 0
Accepted
time: 22ms
memory: 9680kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 627 30000
2 46
48 6
42 10
35 38
19 24
47 39
37 7
12 39
12 31
6 43
9 5
25 28
12 26
30 16
41 48
45 11
44 31
47 15
31 32
36 37
32 43
36 15
7 48
27 28
26 20
0 6
31 18
45 35
37 3
9 20
5 20
40 2
7 43
35 33
39 15
40 27
0 39
28 42
0 38
17 46
6 7...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
38 25 84 31 0 28 45 10 49 9 1 6 93 59 29 2 15 12 8 7 56 21 17 72 13 39 26 53 4 24 74 104 89 42 11 35 23 37 76 48 18 16 20 33 27 3 19 5 14

result:

ok correct

Test #28:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 270 30000
20 36
24 11
20 31
45 48
12 16
11 10
36 8
19 31
3 49
6 45
31 33
37 20
41 46
19 33
45 13
44 26
23 20
49 16
40 27
46 45
19 26
33 28
15 25
28 26
43 16
1 31
9 16
19 36
30 9
13 41
0 48
15 49
13 21
28 35
25 49
35 1
47 14
21 41
16 25
1...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
217 159 15 173 44 19 135 18 30 25 87 62 55 8 65 72 56 9 43 6 28 26 57 5 1 4 32 14 36 31 22 24 17 20 7 16 11 2 0 51 76 77 33 21 75 10 12 86 3

result:

ok correct

Test #29:

score: 0
Accepted
time: 8ms
memory: 11868kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 130 30000
26 14
28 25
10 31
20 12
12 39
12 28
41 19
48 5
20 24
27 4
21 43
21 45
11 29
14 46
29 13
36 27
40 11
0 30
32 34
22 30
27 46
6 22
34 40
46 4
13 15
6 49
22 8
49 22
46 36
42 5
45 43
16 32
30 9
26 27
21 37
27 14
2 30
34 23
18 42
21 ...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
43 19 54 70 29 53 118 123 3 14 15 11 25 17 51 36 9 7 21 83 26 32 64 2 45 16 12 65 5 4 24 13 0 49 31 48 47 38 6 8 39 34 10 37 1 20 18 22 46

result:

ok correct

Test #30:

score: 0
Accepted
time: 26ms
memory: 9796kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 625 30000
34 44
19 12
6 24
31 33
30 11
10 40
7 43
46 39
47 4
36 15
8 27
42 21
35 16
26 48
17 29
2 1
0 25
23 14
20 3
32 18
49 13
41 37
22 9
28 38
5 45
17 7
32 0
26 19
19 43
34 45
48 37
48 3
23 37
39 12
22 37
32 49
17 38
19 11
46 26
24 27
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
3 54 40 26 16 75 15 58 42 31 18 8 24 45 2 25 6 10 22 55 5 46 37 4 33 1 20 17 9 64 12 36 14 19 28 27 11 41 34 32 39 13 23 35 29 0 30 21 7

result:

ok correct

Test #31:

score: 0
Accepted
time: 22ms
memory: 11952kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 625 30000
37 43
38 19
3 37
27 46
35 26
15 7
47 34
25 49
2 45
5 20
28 44
11 22
33 1
36 31
16 42
40 32
43 24
6 8
12 14
18 4
9 21
23 48
41 30
13 29
10 0
42 27
20 26
20 9
24 0
32 39
11 10
14 21
11 28
20 46
24 14
18 34
13 18
42 30
43 41
16 9
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
3 28 24 12 8 42 2 19 9 40 17 49 5 27 20 30 32 11 51 18 45 36 23 34 31 14 72 35 1 33 26 52 21 16 43 7 4 25 10 37 22 13 29 15 6 50 0 48 61

result:

ok correct

Test #32:

score: 0
Accepted
time: 22ms
memory: 11748kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 625 30000
25 29
39 24
9 31
10 34
16 41
7 30
46 36
11 27
42 22
18 8
14 20
35 13
5 21
4 26
1 29
0 44
33 43
37 15
38 6
19 32
2 48
23 17
45 40
49 28
47 25
8 35
1 38
4 49
5 14
41 28
16 34
8 41
22 4
44 21
8 37
45 44
14 24
13 32
1 27
31 11
40 0...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
10 15 38 26 14 20 45 41 32 27 13 28 12 18 58 5 34 31 25 9 2 62 3 42 39 7 67 37 11 36 17 30 4 21 46 19 43 33 8 1 24 0 29 23 16 6 96 22 35

result:

ok correct

Test #33:

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

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
50 625 30000
43 10
21 5
12 24
8 3
16 18
32 28
41 39
26 40
1 7
47 48
42 43
44 29
6 35
9 22
37 33
27 23
10 19
25 45
46 2
17 15
38 34
0 31
20 49
13 11
36 4
6 36
8 48
36 16
15 49
22 17
7 32
34 29
19 13
30 18
7 0
26 29
15 8
43 6
22 25
12 10
6 8
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
7 34 21 8 43 18 3 42 24 1 40 37 25 12 59 30 36 26 13 47 39 16 0 23 2 32 75 28 19 27 4 29 33 22 38 57 15 17 35 5 31 11 41 14 20 46 6 10 9

result:

ok correct

Subtask #3:

score: 0
Wrong Answer

Dependency #2:

100%
Accepted

Test #34:

score: 0
Wrong Answer
time: 493ms
memory: 12372kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
240 28680 30000
77 105
206 25
9 149
62 63
186 223
157 69
181 222
103 184
97 50
227 3
60 109
51 3
188 65
213 224
33 209
133 213
84 23
189 158
138 141
191 195
221 106
44 49
195 86
90 231
202 204
83 43
192 37
46 21
76 34
126 234
59 213
197 41
...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
WA
NO

result:

wrong answer WA in grader: NO

Subtask #4:

score: 0
Wrong Answer

Test #58:

score: 19
Accepted
time: 0ms
memory: 9664kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
2 1 12000
1 0
0

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
0

result:

ok correct

Test #59:

score: 0
Accepted
time: 5ms
memory: 9736kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
10 45 12000
4 8
0 5
2 0
5 8
8 0
3 8
6 4
4 1
2 3
2 1
6 2
1 7
3 7
8 1
7 0
8 6
0 6
9 5
9 6
7 4
7 6
7 9
1 6
3 5
2 5
7 5
3 9
0 3
3 6
2 9
1 5
0 4
7 8
5 4
9 4
5 6
3 1
2 8
7 2
2 4
1 0
9 8
4 3
1 9
9 0
22 41 3 16 7 25 28 11 39

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
OK
39 16 22 11 7 28 25 3 41

result:

ok correct

Test #60:

score: -19
Wrong Answer
time: 435ms
memory: 13028kb

input:

wrslcnopzlckvxbnair_input_simurgh_lmncvpisadngpiqdfngslcnvd
400 79800 12000
32 64
96 254
115 203
7 171
112 81
124 143
336 175
217 328
152 133
124 331
19 91
92 232
152 43
215 169
4 341
363 18
83 99
52 46
248 66
242 187
150 319
335 158
172 150
3 49
126 256
60 153
165 230
265 68
119 380
171 22
35 169
3...

output:

lxndanfdiadsfnslkj_output_simurgh_faifnbsidjvnsidjbgsidjgbs
WA
NO

result:

wrong answer WA in grader: NO

Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%