QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#267102 | #7738. Equivalent Rewriting | mulberry# | TL | 118ms | 28476kb | C++23 | 2.2kb | 2023-11-26 22:32:09 | 2023-11-26 22:32:10 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int t, n, m, k;
vector<int> edge[200005];
vector<int> e[200005];
int d[200005];
queue<int> q;
int ans[200005];
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
// scanf("%d", &t);
cin >> t;
while (t--) {
// scanf("%d%d", &m, &n);
cin >> m >> n;
for (int i = 1; i <= n; i++) {
edge[i].clear();
}
for (int i = 1; i <= m; i++) {
// scanf("%d", &k);
cin >> k;
for (int j = 1, x; j <= k; j++) {
// scanf("%d", &x);
cin >> x;
edge[x].push_back(i);
}
}
// puts("!!!\n");
for (int i = 1; i <= n; i++) {
if (edge[i].size() <= 1) continue;
for (int j = 0; j < edge[i].size() - 1; j++) {
e[edge[i][j]].push_back(edge[i][edge[i].size() - 1]);
d[edge[i][edge[i].size() - 1]]++;
}
}
while (!q.empty()) q.pop();
int cnt = 0;
bool flag = 0;
for (int i = 1; i <= m; i++) {
if (d[i] == 0) {
q.push(i);
cnt++;
}
}
int tot = 0;
// printf("%d!!!\n", cnt);
while (!q.empty()) {
if (cnt > 1) {
flag = 1;
int tmp = q.front();
q.pop();
q.push(tmp);
}
int u = q.front();
ans[++tot] = u;
q.pop();
cnt--;
for (int i = 0; i < e[u].size(); i++) {
int v = e[u][i];
d[v]--;
if (!d[v]) {
q.push(v);
}
}
}
if (!flag) {
// puts("No");
cout << "No\n";
} else {
// puts("Yes");
cout << "Yes\n";
for (int i = 1; i <= m; i++) {
// printf("%d ", ans[i]);
cout << ans[i] << ' ';
}
// puts("");
cout << "\n";
}
}
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 13876kb
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 3 1 2 No No
result:
ok OK. (3 test cases)
Test #2:
score: 0
Accepted
time: 0ms
memory: 12932kb
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 4 6 8 3 7 5 1 9 10
result:
ok OK. (1 test case)
Test #3:
score: 0
Accepted
time: 0ms
memory: 14236kb
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 4 6 8 10 12 14 16 18 3 7 11 15 1 9 17 13 5 19 20
result:
ok OK. (1 test case)
Test #4:
score: 0
Accepted
time: 3ms
memory: 13736kb
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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 35 1 5 9 13 17 21 25 29 33 3 11 19 27 36 15 31 34 23 7 39 38 37 40
result:
ok OK. (1 test case)
Test #5:
score: 0
Accepted
time: 3ms
memory: 13376kb
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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 93 95 98 3 7 11 15 19 23 27 31 35 39 43 47 51 55 59 63 67 71 75 79 83 87 91 96 5 13 21 29 37 45 53 61 69 77 85 94 9 25 41 57 73 89 17 49 81 33 1 65 92 97 99 100
result:
ok OK. (1 test case)
Test #6:
score: 0
Accepted
time: 3ms
memory: 14932kb
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 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 1...
result:
ok OK. (1 test case)
Test #7:
score: 0
Accepted
time: 26ms
memory: 19668kb
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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 1...
result:
ok OK. (1 test case)
Test #8:
score: 0
Accepted
time: 48ms
memory: 24812kb
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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 1...
result:
ok OK. (1 test case)
Test #9:
score: 0
Accepted
time: 43ms
memory: 23296kb
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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 1...
result:
ok OK. (1 test case)
Test #10:
score: 0
Accepted
time: 53ms
memory: 24484kb
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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 1...
result:
ok OK. (1 test case)
Test #11:
score: 0
Accepted
time: 56ms
memory: 24784kb
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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 1...
result:
ok OK. (1 test case)
Test #12:
score: 0
Accepted
time: 5ms
memory: 13320kb
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 4 3 1 5 6 7 8 9 10
result:
ok OK. (1 test case)
Test #13:
score: 0
Accepted
time: 43ms
memory: 25132kb
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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 1...
result:
ok OK. (1 test case)
Test #14:
score: 0
Accepted
time: 3ms
memory: 14212kb
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: 15ms
memory: 18152kb
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 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 1...
result:
ok OK. (1 test case)
Test #16:
score: 0
Accepted
time: 69ms
memory: 28476kb
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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 1...
result:
ok OK. (1 test case)
Test #17:
score: 0
Accepted
time: 58ms
memory: 27384kb
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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 1...
result:
ok OK. (1 test case)
Test #18:
score: 0
Accepted
time: 62ms
memory: 27264kb
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 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 1...
result:
ok OK. (1 test case)
Test #19:
score: 0
Accepted
time: 118ms
memory: 26000kb
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 2 4 31 36 40 43 45 47 53 56 58 61 64 66 69 71 76 80 82 84 86 89 91 93 95 97 100 105 109 113 115 117 120 124 126 130 133 136 139 142 145 147 149 151 156 159 163 165 167 169 171 173 175 178 180 183 187 192 194 196 198 202 206 208 210 215 218 222 228 230 233 235 238 242 244 246 250 253 256 258 260 ...
result:
ok OK. (1 test case)
Test #20:
score: 0
Accepted
time: 4ms
memory: 13560kb
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 35 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 192 194 196 198 200 202 204 206 208 210 212 214 216 218 220 222 224 226 228 230 232 234 236 238 240 242 244 246 2...
result:
ok OK. (1 test case)
Test #21:
score: 0
Accepted
time: 4ms
memory: 15340kb
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 707 1002 1004 1006 1008 1010 1012 1014 1016 1018 1020 1022 1024 1026 1028 1030 1032 1034 1036 1038 1040 1042 1044 1046 1048 1050 1052 1054 1056 1058 1060 1062 1064 1066 1068 1070 1072 1074 1076 1078 1080 1082 1084 1086 1088 1090 1092 1094 1096 1098 1100 1102 1104 1106 1108 1110 1112 1114 1116 11...
result:
ok OK. (1 test case)
Test #22:
score: 0
Accepted
time: 7ms
memory: 15448kb
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 2892 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2893 18 19 2894 20 2895 21 2896 22 2897 23 2898 24 2899 25 2900 26 2901 27 2902 28 2903 29 2904 30 2905 31 2906 32 2907 33 2908 34 2909 35 2910 36 2911 37 2912 38 2913 39 2914 40 2915 41 2916 42 2917 43 2918 44 2919 45 2920 46 2921 47 2922 48 2923 4...
result:
ok OK. (1 test case)
Test #23:
score: 0
Accepted
time: 10ms
memory: 16636kb
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 1131 1 1132 2 1133 3 4 5 1134 6 1135 7 1136 8 1137 9 1138 10 1139 11 1140 12 1141 13 1142 14 1143 15 1144 16 1145 17 1146 18 1147 19 1148 20 1149 21 1150 22 1151 23 1152 24 1153 25 1154 26 1155 27 1156 28 1157 29 1158 30 1159 31 1160 32 1161 33 1162 34 1163 35 1164 36 1165 37 1166 38 1167 39 116...
result:
ok OK. (1 test case)
Test #24:
score: 0
Accepted
time: 28ms
memory: 19976kb
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 89286 1 89287 2 89288 3 89289 4 89290 5 89291 6 89292 7 89293 8 89294 9 89295 10 89296 11 89297 12 89298 13 89299 14 89300 15 89301 16 89302 17 89303 18 89304 19 89305 20 89306 21 89307 22 89308 23 89309 24 89310 25 89311 26 89312 27 89313 28 89314 29 89315 30 89316 31 89317 32 89318 33 89319 34...
result:
ok OK. (1 test case)
Test #25:
score: 0
Accepted
time: 21ms
memory: 17604kb
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 14899 1 14900 2 14901 3 14902 4 14903 5 14904 6 14905 7 14906 8 14907 9 14908 10 14909 11 14910 12 14911 13 14912 14 14913 15 14914 16 14915 17 14916 18 14917 19 14918 20 14919 21 14920 22 14921 23 14922 24 14923 25 14924 26 14925 27 14926 28 14927 29 14928 30 14929 31 14930 32 14931 33 14932 34...
result:
ok OK. (1 test case)
Test #26:
score: 0
Accepted
time: 27ms
memory: 18960kb
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 26273 50002 50004 50006 50008 50010 50012 50014 50016 50018 50020 50022 50024 50026 50028 50030 50032 50034 50036 50038 50040 50042 50044 50046 50048 50050 50052 50054 50056 50058 50060 50062 50064 50066 50068 50070 50072 50074 50076 50078 50080 50082 50084 50086 50088 50090 50092 50094 50096 50...
result:
ok OK. (1 test case)
Test #27:
score: 0
Accepted
time: 15ms
memory: 18016kb
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 7564 10002 10004 10006 10008 10010 10012 10014 10016 10018 10020 10022 10024 10026 10028 10030 10032 10034 10036 10038 10040 10042 10044 10046 10048 10050 10052 10054 10056 10058 10060 10062 10064 10066 10068 10070 10072 10074 10076 10078 10080 10082 10084 10086 10088 10090 10092 10094 10096 100...
result:
ok OK. (1 test case)
Test #28:
score: 0
Accepted
time: 12ms
memory: 17412kb
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 2976 10001 10003 10005 10007 10009 10011 10013 10015 10017 10019 10021 10023 10025 10027 10029 10031 10033 10035 10037 10039 10041 10043 10045 10047 10049 10051 10053 10055 10057 10059 10061 10063 10065 10067 10069 10071 10073 10075 10077 10079 10081 10083 10085 10087 10089 10091 10093 10095 100...
result:
ok OK. (1 test case)
Test #29:
score: 0
Accepted
time: 15ms
memory: 17244kb
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:
No
result:
ok OK. (1 test case)
Test #30:
score: 0
Accepted
time: 26ms
memory: 19328kb
input:
1 100000 50000 1 16235 2 16235 5024 2 5024 5075 2 5075 15612 2 15612 1874 2 1874 46975 2 46975 23015 2 23015 22230 2 22230 24685 2 24685 27514 2 27514 19421 2 19421 3372 2 3372 30435 2 30435 47871 2 47871 41270 2 41270 29787 2 29787 7743 2 7743 16624 2 16624 27627 2 27627 423 2 423 9245 2 9245 16307...
output:
Yes 50001 50003 50005 50007 50009 50011 50013 50015 50017 50019 50021 50023 50025 50027 50029 50031 50033 50035 50037 50039 50041 50043 50045 50047 50049 50051 50053 50055 50057 50059 50061 50063 50065 50067 50069 50071 50073 50075 50077 50079 50081 50083 50085 50087 50089 50091 50093 50095 50097 50...
result:
ok OK. (1 test case)
Test #31:
score: 0
Accepted
time: 12ms
memory: 18252kb
input:
1 100000 10000 1 1702 2 1702 2977 2 2977 6117 2 6117 3553 2 3553 5771 2 5771 8991 2 8991 6852 2 6852 1631 2 1631 7411 2 7411 9172 2 9172 3814 2 3814 7048 2 7048 4376 2 4376 7515 2 7515 6310 2 6310 8715 2 8715 6085 2 6085 5902 2 5902 175 2 175 1347 2 1347 8011 2 8011 3487 2 3487 7329 2 7329 936 2 936...
output:
Yes 10001 10003 10005 10007 10009 10011 10013 10015 10017 10019 10021 10023 10025 10027 10029 10031 10033 10035 10037 10039 10041 10043 10045 10047 10049 10051 10053 10055 10057 10059 10061 10063 10065 10067 10069 10071 10073 10075 10077 10079 10081 10083 10085 10087 10089 10091 10093 10095 10097 10...
result:
ok OK. (1 test case)
Test #32:
score: 0
Accepted
time: 13ms
memory: 17496kb
input:
1 100000 9999 1 269 2 269 4842 2 4842 9066 2 9066 6409 2 6409 919 2 919 4609 2 4609 2210 2 2210 9333 2 9333 1082 2 1082 419 2 419 1588 2 1588 4379 2 4379 9750 2 9750 5183 2 5183 5999 2 5999 4545 2 4545 9101 2 9101 377 2 377 451 2 451 8999 2 8999 726 2 726 7163 2 7163 6671 2 6671 4989 2 4989 7806 2 7...
output:
Yes 10000 10002 10004 10006 10008 10010 10012 10014 10016 10018 10020 10022 10024 10026 10028 10030 10032 10034 10036 10038 10040 10042 10044 10046 10048 10050 10052 10054 10056 10058 10060 10062 10064 10066 10068 10070 10072 10074 10076 10078 10080 10082 10084 10086 10088 10090 10092 10094 10096 10...
result:
ok OK. (1 test case)
Test #33:
score: 0
Accepted
time: 24ms
memory: 20024kb
input:
1 100000 100000 1 40715 2 40715 69975 2 69975 81076 2 81076 50941 2 50941 61666 2 61666 58686 2 58686 77487 2 77487 43412 2 43412 11756 2 11756 38852 2 38852 25829 2 25829 14629 2 14629 40633 2 40633 79986 2 79986 7237 2 7237 95744 2 95744 98665 2 98665 75424 2 75424 75964 2 75964 99876 2 99876 3449...
output:
No
result:
ok OK. (1 test case)
Test #34:
score: 0
Accepted
time: 3ms
memory: 13316kb
input:
1 10 10 6 7 1 6 8 2 5 3 7 1 4 2 1 5 2 5 3 6 3 6 2 4 8 9 3 6 2 9 3 2 9 8 3 9 8 4 2 8 4 1 4
output:
No
result:
ok OK. (1 test case)
Test #35:
score: 0
Accepted
time: 0ms
memory: 14120kb
input:
1 5 10 8 8 10 5 7 6 3 1 4 4 1 6 5 7 5 7 6 1 10 3 5 6 3 10 9 1 2 3 1
output:
No
result:
ok OK. (1 test case)
Test #36:
score: 0
Accepted
time: 3ms
memory: 14036kb
input:
1 7 8 5 3 1 2 5 6 3 3 5 1 5 5 8 1 6 4 3 8 1 4 4 1 6 2 4 2 6 2 1 2
output:
No
result:
ok OK. (1 test case)
Test #37:
score: 0
Accepted
time: 7ms
memory: 15072kb
input:
1 2 100000 14270 46635 46698 1646 15716 2228 50409 74925 97781 74365 25891 12012 64493 21689 94826 36200 1632 24144 62892 32086 47204 79241 98139 79911 17992 46167 52734 60646 15562 38928 98569 3653 3671 78062 60439 55428 8130 90832 16564 66569 41939 90137 70795 10888 47855 26734 15687 58488 45392 1...
output:
No
result:
ok OK. (1 test case)
Test #38:
score: 0
Accepted
time: 7ms
memory: 15000kb
input:
1 1 100000 36897 18529 93504 47258 14497 23607 217 5522 37137 77238 60045 9885 11754 78586 36262 50169 94021 79684 70802 61672 70563 90359 26273 78607 54598 47388 39719 51290 60373 45630 10944 92439 87100 86543 99975 72598 87465 27042 92093 96656 71345 334 85993 31389 2345 23153 64562 93724 88845 65...
output:
No
result:
ok OK. (1 test case)
Test #39:
score: 0
Accepted
time: 0ms
memory: 12932kb
input:
1 3 3 2 1 3 2 1 2 3 1 2 3
output:
Yes 2 1 3
result:
ok OK. (1 test case)
Test #40:
score: -100
Time Limit Exceeded
input:
56035 9 9 7 1 7 3 6 8 4 2 2 8 4 3 6 3 5 3 6 7 2 7 5 3 9 1 2 8 4 6 8 9 7 3 1 6 8 3 4 9 5 1 6 7 8 5 9 8 7 5 1 2 3 2 9 4 1 4 4 3 2 4 1 3 2 3 1 1 1 1 3 3 3 4 1 3 3 2 1 4 3 1 4 2 3 3 4 1 4 10 8 2 7 3 6 1 9 8 5 5 6 4 8 7 5 3 2 8 6 6 3 4 1 8 2 5 10 10 4 3 8 1 2 3 2 9 10 3 1 7 9 6 9 7 10 3 4 8 10 9 3 5 10 8...
output:
Yes 2 4 6 3 1 5 7 9 8 Yes 2 4 6 1 8 7 3 5 9 No Yes 2 4 6 3 1 5 3 5 9 0 No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No 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...