QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#275375#7738. Equivalent RewritingKXDdesuWA 64ms36552kbC++202.7kb2023-12-04 17:30:492023-12-04 17:30:50

Judging History

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

  • [2023-12-04 17:30:50]
  • 评测
  • 测评结果:WA
  • 用时:64ms
  • 内存:36552kb
  • [2023-12-04 17:30:49]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define all(x) (x).begin(), (x).end()
using pii = std::pair<int, int>;
void solve()
{
    int n, m;
    std::cin >> n >> m;
    std::vector<std::vector<int>> p(n + 1);
    for (int i = 1; i <= n; i ++)
    {
        int x;
        std::cin >> x;
        for (int j = 0; j < x; j ++)
        {
            int y;
            std::cin >> y;
            p[i].push_back(y);
        }
    }
    std::vector<std::vector<int>> adj(n + 1);
    std::vector<int> num(m + 1);
    std::vector<int> din(n + 1);
    for (int i = 1; i <= n; i ++)
    {
        for (int j = 0; j < p[i].size(); j ++)
        {
            if (!num[p[i][j]]) num[p[i][j]] = i;
            else
            {
                adj[num[p[i][j]]].push_back(i);
                din[i] ++;
                num[p[i][j]] = i;
            }
        }
    }
    // for (int i = 1; i <= m; i ++)
    //     std::cerr << num[i] << " \n"[i == m];
    std::vector<int> q(n);
    int hh = 0, tt = -1;
    for (int i = 1; i <= n; i ++)
        if (!din[i])
            q[++ tt] = i;
    std::vector<int> cnt(n);
    std::iota(all(cnt), 1);
    while (hh <= tt)
    {
        int t = q[hh ++ ];
        for (auto j : adj[t])
        {
            if (-- din[j] == 0)
                q[++ tt] = j;
        }
    }
    bool ok = false;
    for (int i = 0; i < n; i ++)
        if (cnt[i] != q[i])
        {
            ok = true;
            break;
        }
    // for (int i = 0; i < n; i ++)
    //     std::cerr << q[i] << " \n"[i == n - 1];
    if (!ok)
    {
        std::vector<bool> st(n + 1);
        for (int i = 1; i <= m; i ++)
            st[num[i]] = true;
        int cnt = 0;
        int pos = 0;
        for (int i = 1; i <= n; i ++)
        {   
            if (!st[i])
            {
                pos = i;
                cnt ++;
                break;
            }
        }
        if (pos)
        {
            std::cout << "Yes\n";
            for (int i = 1; i <= n; i ++)
            {
                if (i == pos) std::cout << pos + 1 << " ";
                else if (i == pos + 1) std::cout << pos << " ";
                else std::cout << i << " ";
            }
            std::cout << "\n";
        }
        else
        {
            std::cout << "No\n";
        }
    }
    else
    {
        std::cout << "Yes\n";
        for (int i = 0; i < n; i ++)
            std::cout << q[i] << " \n"[i == n - 1];
    }
}
signed main()
{
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);
    int T = 1;
    std::cin >> T;
    while (T --) solve();
    return 0;
}

詳細信息

Test #1:

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

input:

3
3 6
3 3 1 5
2 5 3
2 2 6
2 3
3 1 3 2
2 3 1
1 3
2 2 1

output:

Yes
1 3 2
No
No

result:

ok OK. (3 test cases)

Test #2:

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

input:

1
10 5
2 2 4
4 1 3 4 2
1 2
3 2 1 4
4 5 2 4 3
3 2 5 4
3 5 4 2
3 1 3 2
5 1 4 2 3 5
1 4

output:

Yes
2 1 3 4 5 6 7 8 9 10 

result:

ok OK. (1 test case)

Test #3:

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

input:

1
20 5
5 4 1 2 5 3
2 5 3
3 5 1 2
5 4 5 1 3 2
3 4 2 5
5 3 1 5 4 2
5 5 1 2 3 4
1 3
4 5 1 2 3
4 4 1 3 5
2 5 2
4 2 3 5 1
3 2 4 5
5 2 3 4 1 5
4 5 2 4 3
1 2
2 4 3
4 4 5 3 1
5 4 1 5 3 2
3 5 1 3

output:

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

result:

ok OK. (1 test case)

Test #4:

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

input:

1
40 10
2 4 1
10 5 8 2 3 6 7 4 1 10 9
3 10 9 7
1 9
10 10 5 6 9 2 8 3 1 4 7
7 8 4 7 5 2 3 6
5 2 6 5 1 10
6 6 5 4 8 7 1
3 4 9 8
9 9 10 4 2 1 8 7 5 3
2 5 7
9 8 6 1 2 9 7 5 10 3
2 8 1
8 8 3 10 9 1 4 5 6
2 3 4
5 5 3 6 2 7
10 3 2 8 9 10 1 7 4 6 5
2 1 9
1 1
3 3 7 4
5 2 6 5 7 1
7 3 2 4 9 10 6 1
1 4
5 6 4 5 ...

output:

Yes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 19 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 39 37 38 40

result:

ok OK. (1 test case)

Test #5:

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

input:

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

output:

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

result:

ok OK. (1 test case)

Test #6:

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

input:

1
5000 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1...

output:

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

result:

ok OK. (1 test case)

Test #7:

score: 0
Accepted
time: 23ms
memory: 15260kb

input:

1
5000 200
2 121 161
35 27 5 1 189 173 2 37 107 140 172 108 53 163 19 127 102 174 71 178 42 72 74 167 118 120 175 28 75 128 106 190 112 86 171 13
109 110 109 183 17 77 159 188 157 56 14 104 55 179 121 171 64 123 196 140 38 29 134 130 163 108 187 42 68 26 156 138 80 143 182 4 174 67 63 76 79 69 142 3...

output:

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

result:

ok OK. (1 test case)

Test #8:

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

input:

1
5000 1000
146 147 426 393 758 104 385 277 218 753 477 377 54 465 635 918 97 453 576 270 57 189 230 227 332 345 358 14 178 969 817 840 620 828 837 94 922 844 789 106 250 952 745 212 693 296 677 368 625 150 103 55 266 756 525 60 91 683 364 852 877 792 312 315 997 27 50 866 759 327 557 56 49 947 644 ...

output:

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

result:

ok OK. (1 test case)

Test #9:

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

input:

1
4999 1000
799 991 88 253 814 577 620 74 338 485 560 435 835 130 279 536 637 188 612 876 634 950 755 534 727 272 657 357 810 113 800 41 439 125 763 311 724 623 976 525 725 869 209 975 888 683 428 4 91 448 936 885 140 233 967 556 369 522 263 483 784 96 808 70 42 391 109 333 778 422 121 862 430 746 6...

output:

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

result:

ok OK. (1 test case)

Test #10:

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

input:

1
5000 5000
2081 3619 2779 2556 4025 163 2942 2539 4075 189 2823 2189 3571 1168 1474 3383 649 1432 2052 1218 645 1053 1833 2651 3651 1611 1512 1267 3727 4182 2237 4827 3905 3335 3268 1627 2212 3697 2241 884 4015 4902 1504 2223 484 3001 2908 4619 4321 2875 4501 87 2442 3850 2760 834 3985 1807 1880 26...

output:

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

result:

ok OK. (1 test case)

Test #11:

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

input:

1
1000 5000
2728 456 1809 201 2171 4389 1597 1911 2218 3081 3818 486 3732 263 2483 2923 527 867 782 3405 3803 4039 838 3743 3589 2153 2818 2946 997 11 899 2656 2024 4474 4802 2978 2070 3056 1919 2475 2205 2563 4339 3179 2508 195 3943 3710 4441 3440 3923 4842 3916 4481 912 3076 4866 710 254 4324 1546...

output:

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

result:

ok OK. (1 test case)

Test #12:

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

input:

1
10 5000
4665 1548 2583 767 790 1820 825 4120 4957 4179 3273 2273 4509 457 3495 667 206 1152 4353 1992 4211 315 4334 905 4043 2826 1094 1708 4132 1046 3359 137 3773 4602 4557 83 605 4257 3514 4430 4968 2253 3041 786 2356 320 1504 1734 4095 1738 2512 3667 140 1487 594 276 3290 4273 4321 87 3343 4451...

output:

Yes
2 1 3 4 5 6 7 8 9 10 

result:

ok OK. (1 test case)

Test #13:

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

input:

1
4999 4999
1640 2673 1066 1994 4702 3817 839 2285 742 4086 1810 4349 4925 4974 4073 3186 3272 4258 893 3357 942 1513 1881 1371 2140 1512 4472 524 2119 3396 1236 4311 4605 1337 910 586 944 1016 4661 1041 2765 481 4021 4994 712 1233 3011 2070 123 356 2703 3891 2559 1158 640 1127 1488 2836 1912 3975 4...

output:

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

result:

ok OK. (1 test case)

Test #14:

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

input:

1
10 10
2 1 2
2 2 3
2 3 4
2 4 5
2 5 6
2 6 7
2 7 8
2 8 9
2 9 10
1 10

output:

No

result:

ok OK. (1 test case)

Test #15:

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

input:

1
100000 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1...

output:

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

result:

ok OK. (1 test case)

Test #16:

score: 0
Accepted
time: 53ms
memory: 36552kb

input:

1
100000 100
30 31 100 5 89 85 53 86 19 62 20 57 81 3 60 82 32 64 27 63 1 94 17 22 8 33 12 23 88 2 11
94 95 89 78 8 74 31 36 5 41 98 99 32 53 88 33 87 40 83 70 21 35 51 81 92 3 37 90 62 1 46 29 20 85 75 65 82 91 22 97 61 12 27 26 77 18 68 15 79 28 84 58 49 54 6 66 59 72 45 17 80 48 34 4 96 19 57 94 ...

output:

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

result:

ok OK. (1 test case)

Test #17:

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

input:

1
100000 1000
53 469 776 408 563 495 552 288 343 745 650 179 791 839 389 881 474 194 27 739 795 103 143 522 261 197 123 923 355 731 154 412 231 600 641 651 247 668 877 535 908 792 90 578 827 841 486 901 402 761 356 433 798 369
526 710 298 313 926 775 961 979 45 549 214 81 805 635 174 930 687 243 619...

output:

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

result:

ok OK. (1 test case)

Test #18:

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

input:

1
100000 10000
2094 5226 2958 8712 7230 6625 2487 4520 9360 2727 5423 5170 3199 3725 2419 9194 1946 9942 7780 9861 692 2218 5879 9116 3253 1191 710 8703 759 3019 3581 3648 105 6123 8494 6356 8000 3056 4478 2646 7457 2437 9669 4132 4585 8874 2930 9024 6773 132 4309 6496 8138 3514 531 4782 5854 1722 5...

output:

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

result:

ok OK. (1 test case)

Test #19:

score: 0
Accepted
time: 64ms
memory: 29884kb

input:

1
100000 100000
13036 23902 71466 9482 98728 78471 22915 2470 5999 53211 25994 3996 11349 30511 56448 17277 78308 18316 42069 38636 63127 26256 63985 57249 58305 64366 17839 28518 18980 95945 36316 6076 69530 96509 6940 6039 56048 41847 82118 41054 49670 95896 45891 74636 90736 75413 27251 87730 683...

output:

Yes
1 2 3 4 5 6 20738 7 17826 43311 84861 92983 8 6368 13524 13880 18054 18185 23056 27373 31717 32382 36759 55462 59044 60109 79326 92838 94238 44725 9 1542 5037 6277 8086 10468 13447 14012 14062 16357 16888 18670 20507 22608 24773 27004 27490 28036 29174 30240 32553 35156 41201 42811 43110 43602 4...

result:

ok OK. (1 test case)

Test #20:

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

input:

1
5000 100
75 80 60 100 11 49 87 84 71 37 92 2 46 24 41 95 20 42 70 74 43 76 68 82 89 15 4 35 72 9 88 93 28 3 64 75 53 97 29 8 48 61 14 1 65 66 10 13 56 21 96 52 83 67 77 30 34 57 99 47 44 91 7 55 59 50 22 63 36 90 31 45 94 40 32 86
43 80 25 67 32 5 65 63 46 81 75 88 100 3 42 62 93 23 76 70 1 60 43 ...

output:

Yes
1 101 2 102 3 103 4 104 5 105 6 106 7 107 8 108 9 109 10 110 11 111 12 112 13 113 14 114 15 115 16 116 17 117 18 118 19 119 20 120 21 121 22 122 23 123 24 124 25 125 26 126 27 127 28 128 29 129 30 130 31 131 32 132 33 133 34 134 35 135 36 136 37 137 38 138 39 139 40 140 41 141 42 142 43 143 44 1...

result:

ok OK. (1 test case)

Test #21:

score: 0
Accepted
time: 6ms
memory: 6176kb

input:

1
5000 1000
588 107 686 736 517 845 211 644 553 738 430 476 252 504 471 297 958 534 484 602 514 855 989 58 957 261 380 308 316 807 42 328 364 239 73 163 215 915 844 401 112 714 873 946 716 230 951 655 294 120 10 712 683 819 415 63 745 433 321 15 542 670 690 377 956 866 697 37 416 269 488 645 986 631...

output:

Yes
1 1001 2 1002 3 1003 4 1004 5 1005 6 1006 7 1007 8 1008 9 1009 10 1010 11 1011 12 1012 13 1013 14 1014 15 1015 16 1016 17 1017 18 1018 19 1019 20 1020 21 1021 22 1022 23 1023 24 1024 25 1025 26 1026 27 1027 28 1028 29 1029 30 1030 31 1031 32 1032 33 1033 34 1034 35 1035 36 1036 37 1037 38 1038 3...

result:

ok OK. (1 test case)

Test #22:

score: 0
Accepted
time: 7ms
memory: 5508kb

input:

1
5000 10000
2844 3485 9550 710 9862 1742 4261 3401 7862 8774 2066 6172 4182 3952 8588 7798 4471 9240 8355 3687 1282 4605 5038 4511 6460 7072 8161 7977 8564 3062 4731 6511 7854 8039 3908 8061 3691 6049 5433 1876 2772 5197 1426 881 1294 7260 6082 6478 2157 1710 8281 487 9210 545 9888 3886 6834 8549 3...

output:

Yes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2892 19 2893 20 2894 21 2895 22 2896 23 2897 24 2898 25 2899 26 2900 27 2901 28 2902 29 2903 30 2904 31 2905 32 2906 33 2907 34 2908 35 2909 36 2910 37 2911 38 2912 39 2913 40 2914 41 2915 42 2916 43 2917 44 2918 45 2919 46 2920 47 2921 48 2922 49 292...

result:

ok OK. (1 test case)

Test #23:

score: 0
Accepted
time: 7ms
memory: 5480kb

input:

1
5000 100000
39293 10913 5181 19479 73743 73041 44034 79530 53967 42351 11365 1224 25452 97871 63229 80000 8498 27936 81102 81043 59677 93828 44118 63275 53964 66063 26803 73527 72659 38043 86078 59238 11483 36144 7084 20768 41417 61851 74604 18748 13113 32530 38112 32969 30342 70998 60607 33987 15...

output:

Yes
1 1131 2 1132 3 4 5 6 1133 7 1134 8 1135 9 1136 10 1137 11 1138 12 1139 13 1140 14 1141 15 1142 16 1143 17 1144 18 1145 19 1146 20 1147 21 1148 22 1149 23 1150 24 1151 25 1152 26 1153 27 1154 28 1155 29 1156 30 1157 31 1158 32 1159 33 1160 34 1161 35 1162 36 1163 37 1164 38 1165 39 1166 40 1167 ...

result:

ok OK. (1 test case)

Test #24:

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

input:

1
100000 100000
1 99697
2 99697 62499
2 62499 65369
2 65369 38767
2 38767 49004
2 49004 41714
2 41714 25240
2 25240 40929
2 40929 74271
2 74271 97963
2 97963 88205
2 88205 44238
2 44238 73947
2 73947 88038
2 88038 34453
2 34453 94958
2 94958 48075
2 48075 26199
2 26199 66549
2 66549 43887
2 43887 35...

output:

Yes
1 89286 2 89287 3 89288 4 89289 5 89290 6 89291 7 89292 8 89293 9 89294 10 89295 11 89296 12 89297 13 89298 14 89299 15 89300 16 89301 17 89302 18 89303 19 89304 20 89305 21 89306 22 89307 23 89308 24 89309 25 89310 26 89311 27 89312 28 89313 29 89314 30 89315 31 89316 32 89317 33 89318 34 89319...

result:

ok OK. (1 test case)

Test #25:

score: 0
Accepted
time: 10ms
memory: 10436kb

input:

1
50000 100000
1 46703
2 46703 55497
2 55497 23493
2 23493 17355
2 17355 85641
2 85641 40451
2 40451 91219
2 91219 41048
2 41048 12518
2 12518 24389
2 24389 41038
2 41038 57974
2 57974 1865
2 1865 75723
2 75723 90283
2 90283 20878
2 20878 13239
2 13239 55992
2 55992 21622
2 21622 32181
2 32181 8511
...

output:

Yes
1 14899 2 14900 3 14901 4 14902 5 14903 6 14904 7 14905 8 14906 9 14907 10 14908 11 14909 12 14910 13 14911 14 14912 15 14913 16 14914 17 14915 18 14916 19 14917 20 14918 21 14919 22 14920 23 14921 24 14922 25 14923 26 14924 27 14925 28 14926 29 14927 30 14928 31 14929 32 14930 33 14931 34 14932...

result:

ok OK. (1 test case)

Test #26:

score: 0
Accepted
time: 23ms
memory: 16724kb

input:

1
100000 50000
1 17436
2 17436 38563
2 38563 6072
2 6072 44215
2 44215 23698
2 23698 6361
2 6361 10273
2 10273 19571
2 19571 9471
2 9471 12671
2 12671 31584
2 31584 31896
2 31896 2213
2 2213 28535
2 28535 32050
2 32050 14148
2 14148 22955
2 22955 19097
2 19097 19557
2 19557 354
2 354 18536
2 18536 3...

output:

Yes
1 26273 50001 2 26274 50002 3 26275 50003 4 26276 50004 5 26277 50005 6 26278 50006 7 26279 50007 8 26280 50008 9 26281 50009 10 26282 50010 11 26283 50011 12 26284 50012 13 26285 50013 14 26286 50014 15 26287 50015 16 26288 50016 17 26289 50017 18 26290 50018 19 26291 50019 20 26292 50020 21 26...

result:

ok OK. (1 test case)

Test #27:

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

input:

1
100000 10000
1 1670
2 1670 9903
2 9903 8088
2 8088 386
2 386 8535
2 8535 8326
2 8326 997
2 997 5841
2 5841 1028
2 1028 1627
2 1627 2622
2 2622 7211
2 7211 5508
2 5508 1647
2 1647 6224
2 6224 4630
2 4630 8145
2 8145 5415
2 5415 4098
2 4098 5354
2 5354 8742
2 8742 6205
2 6205 1258
2 1258 3625
2 3625...

output:

Yes
1 7564 10001 2 7565 10002 3 7566 10003 4 7567 10004 5 7568 10005 6 7569 10006 7 7570 10007 8 7571 10008 9 7572 10009 10 7573 10010 11 7574 10011 12 7575 10012 13 7576 10013 14 7577 10014 15 7578 10015 16 7579 10016 17 7580 10017 18 7581 10018 19 7582 10019 20 7583 10020 21 7584 10021 22 7585 100...

result:

ok OK. (1 test case)

Test #28:

score: 0
Accepted
time: 15ms
memory: 16496kb

input:

1
100000 9999
1 1714
2 1714 7447
2 7447 7246
2 7246 2788
2 2788 3876
2 3876 7970
2 7970 5074
2 5074 6179
2 6179 2036
2 2036 7908
2 7908 6148
2 6148 1571
2 1571 1333
2 1333 988
2 988 1311
2 1311 1045
2 1045 1352
2 1352 5177
2 5177 5601
2 5601 8933
2 8933 2175
2 2175 5244
2 5244 7087
2 7087 6886
2 688...

output:

Yes
1 2976 10000 2 2977 10001 3 2978 10002 4 2979 10003 5 2980 10004 6 2981 10005 7 2982 10006 8 2983 10007 9 2984 10008 10 2985 10009 11 2986 10010 12 2987 10011 13 2988 10012 14 2989 10013 15 2990 10014 16 2991 10015 17 2992 10016 18 2993 10017 19 2994 10018 20 2995 10019 21 2996 10020 22 2997 100...

result:

ok OK. (1 test case)

Test #29:

score: -100
Wrong Answer
time: 11ms
memory: 10424kb

input:

1
50000 100000
1 25288
2 25288 60248
2 60248 40896
2 40896 3119
2 3119 15191
2 15191 20054
2 20054 37056
2 37056 48410
2 48410 15293
2 15293 6218
2 6218 62584
2 62584 59101
2 59101 67460
2 67460 78740
2 78740 67628
2 67628 45650
2 45650 10725
2 10725 74693
2 74693 81131
2 81131 41197
2 41197 59032
2...

output:

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

result:

wrong answer two transactions are not equivalent. (test case 1)