QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#91375 | #265. 正则二分图匹配 | Crysfly# | 100 ✓ | 2826ms | 140992kb | C++11 | 1.2kb | 2023-03-28 18:18:06 | 2023-03-28 18:18:10 |
Judging History
answer
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
using namespace std;
inline int read()
{
char c=getchar();int x=0;bool f=0;
for(;!isdigit(c);c=getchar())f^=!(c^45);
for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
if(f)x=-x;return x;
}
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;
#define maxn 2000005
#define inf 0x3f3f3f3f
int n,d,id[maxn];
vi e[maxn];
mt19937_64 rnd(114514);
int tol[maxn],tor[maxn];
int st[maxn*20],tp;
bool vis[maxn];
signed main()
{
// freopen("match3.in","r",stdin);
n=read(),d=read();
For(i,1,n){
e[i].resize(d);
for(int&x:e[i])x=read();
}
iota(id+1,id+n+1,1),shuffle(id+1,id+n+1,rnd);
For(_,1,n){
int u=id[_];
tp=0;
int j=u;
while(j){
int t=e[j][rnd()%d];
while(t==tor[j])t=e[j][rnd()%d];
while(vis[t]) vis[st[tp--]]=0;
vis[t]=1;
st[++tp]=t;
j=tol[t];
}
while(tp){
int u=st[tp],lst=st[tp-1]; --tp;
tor[tol[lst]]=u;
tol[u]=tol[lst];
vis[u]=0;
}
tor[u]=st[1];
tol[st[1]]=u;
}
For(i,1,n)printf("%d ",tor[i]);
return 0;
}
详细
Test #1:
score: 3.0303
Accepted
time: 76ms
memory: 62960kb
input:
200000 1 4860 68405 196988 88061 63179 145556 153543 137408 73529 98133 121426 169157 139971 30468 40561 61417 2377 128946 78342 104898 53132 19812 6001 76501 144382 28176 104732 93137 81527 47685 16750 178443 30278 34394 36927 144836 113402 150495 198662 154016 49033 63788 118907 17990 25923 171718...
output:
4860 68405 196988 88061 63179 145556 153543 137408 73529 98133 121426 169157 139971 30468 40561 61417 2377 128946 78342 104898 53132 19812 6001 76501 144382 28176 104732 93137 81527 47685 16750 178443 30278 34394 36927 144836 113402 150495 198662 154016 49033 63788 118907 17990 25923 171718 199418 8...
result:
ok a perfect matching
Test #2:
score: 3.0303
Accepted
time: 95ms
memory: 58896kb
input:
100000 2 38701 64233 21385 98890 44018 45182 4039 81322 19092 98375 6549 69934 60546 82625 61820 88847 80625 98712 6227 9161 47457 91129 69077 71917 48385 81391 40048 85262 10964 28517 55941 72848 35865 43668 14735 97999 79332 90768 40710 94535 77099 85283 43429 80203 21562 48738 62878 80027 1251 44...
output:
64233 98890 45182 4039 98375 69934 82625 61820 98712 9161 91129 71917 81391 40048 28517 55941 43668 14735 90768 94535 77099 43429 48738 80027 1251 95683 3554 82308 74040 41400 48086 62117 40713 28633 1726 12755 36642 84843 96458 31819 12260 77366 78075 81570 68967 67263 43515 96170 90595 96142 38284...
result:
ok a perfect matching
Test #3:
score: 3.0303
Accepted
time: 56ms
memory: 57508kb
input:
66666 3 2865 7709 21957 3002 30528 66049 3259 33642 55999 27855 64335 65310 3379 7925 44323 21726 35131 35446 20806 52528 63257 6408 27039 50557 15771 37822 58917 29235 34506 64074 9789 11376 42730 6007 25251 46717 4858 28813 65939 10460 37494 38602 18356 26954 46940 20154 50645 56311 10095 17174 34...
output:
7709 30528 33642 27855 3379 35131 20806 6408 58917 29235 9789 46717 28813 38602 26954 20154 34805 52076 32779 21328 59655 46145 23515 47027 31863 27065 52130 38212 60419 27892 11569 52945 37938 18006 44265 36467 48870 41943 63154 63022 10873 20156 47574 25549 28272 43328 41413 33808 43681 6160 12914...
result:
ok a perfect matching
Test #4:
score: 3.0303
Accepted
time: 19ms
memory: 55820kb
input:
20000 10 4453 4938 7489 8143 8851 14086 15777 15856 19810 19994 1101 1589 3045 4999 7145 8862 10949 13906 14209 19253 813 936 1987 3395 4231 9971 10028 10087 13816 17859 295 1543 6587 10106 10944 11046 12258 14673 15335 16861 1299 1466 3906 4352 4908 5370 12314 15702 16937 18602 1625 1957 1971 4818 ...
output:
4938 7145 13816 1543 16937 10908 4264 3961 12671 2366 13267 322 10207 12845 16539 2253 12418 8157 11965 7622 10453 2563 18307 19504 18555 5016 17697 17253 10993 11275 6424 7201 9304 19770 14837 8948 8574 18899 18680 16555 10982 1496 2423 9215 9810 10723 14898 6415 11445 1420 3869 13830 2700 10312 89...
result:
ok a perfect matching
Test #5:
score: 3.0303
Accepted
time: 11ms
memory: 55752kb
input:
10000 20 798 829 835 1016 1195 2218 3476 3501 3863 4059 4073 4687 6721 7114 7148 7348 8500 8532 8775 9158 541 778 816 1906 2526 2578 3326 3607 4160 4522 4820 6306 6687 6923 8549 8695 8985 9347 9553 9994 159 382 543 648 1201 1650 2562 3014 3235 3376 3505 3876 5740 6798 7148 7580 8320 8525 9424 9521 2...
output:
3501 9347 5740 6700 7836 7581 5522 6739 3453 5852 5941 536 402 7662 2390 9737 3167 8633 6684 7482 9937 4359 3860 2623 7058 6510 918 362 5644 2256 8213 6243 8823 4453 7215 2980 7919 279 5704 2289 6680 4373 6077 1859 8065 5216 6798 3664 2679 9933 2965 167 9695 4243 5516 3872 6618 9771 2379 3037 6042 4...
result:
ok a perfect matching
Test #6:
score: 3.0303
Accepted
time: 14ms
memory: 55624kb
input:
4000 50 330 432 487 676 726 738 833 937 949 954 975 994 1032 1051 1099 1132 1183 1346 1547 1566 1617 1720 1721 1774 1803 1980 2193 2328 2350 2413 2426 2587 2691 2792 2976 3021 3066 3119 3171 3477 3484 3533 3577 3605 3618 3731 3803 3874 3918 3994 28 75 214 265 313 319 335 366 403 556 714 804 924 938 ...
output:
2691 2362 237 1239 225 1246 96 1632 3051 1609 2471 600 671 3628 317 683 958 3257 2378 3031 724 2646 2810 3744 800 1243 313 227 1079 57 1450 2282 830 1739 3309 784 1063 2755 2834 2299 3089 2678 1722 2419 2591 1771 2417 236 2457 2540 2814 2193 2129 2382 1000 3247 1180 3873 1257 2702 1929 2980 1527 723...
result:
ok a perfect matching
Test #7:
score: 3.0303
Accepted
time: 17ms
memory: 55636kb
input:
2000 100 4 12 54 56 69 85 113 123 128 183 207 209 212 212 247 249 310 330 347 377 403 409 421 435 484 500 504 526 540 556 571 578 589 648 648 694 727 732 732 790 797 838 871 880 889 950 973 1018 1018 1025 1063 1109 1116 1145 1197 1230 1239 1258 1266 1268 1284 1304 1307 1376 1383 1386 1395 1404 1412 ...
output:
1376 605 1642 1616 1081 577 528 1962 848 647 1193 385 581 363 197 1743 1611 1613 1607 149 1342 609 669 1338 1099 1478 1939 255 1176 1980 1922 1683 1001 1650 1513 469 663 1015 867 503 807 1979 700 793 1828 1940 184 1545 1998 616 41 1850 780 1278 1094 1907 1834 346 628 1276 1344 823 1212 449 741 1827 ...
result:
ok a perfect matching
Test #8:
score: 3.0303
Accepted
time: 15ms
memory: 55536kb
input:
1000 200 3 9 11 14 28 33 35 38 44 63 74 83 83 95 100 104 106 106 109 118 128 131 132 132 140 142 143 144 145 145 145 149 150 155 161 166 167 172 173 174 174 175 183 190 194 198 201 201 203 203 204 215 217 223 225 242 248 258 267 269 272 272 275 278 281 293 297 299 318 320 334 339 343 344 344 347 348...
output:
871 202 626 237 38 280 634 297 53 380 476 82 457 316 658 459 820 599 134 527 413 347 571 60 261 226 241 739 697 220 136 358 834 215 551 373 20 566 717 847 390 253 190 224 332 664 873 769 829 542 171 633 268 991 364 365 336 714 640 725 339 276 427 185 371 484 835 702 908 195 95 68 157 733 975 576 370...
result:
ok a perfect matching
Test #9:
score: 3.0303
Accepted
time: 3ms
memory: 53572kb
input:
666 300 1 1 5 5 11 13 13 14 19 23 25 25 25 28 31 31 31 34 36 36 37 41 44 44 45 46 52 54 55 57 58 59 61 62 65 66 67 68 71 72 75 81 81 83 84 84 87 90 92 93 93 94 95 99 99 101 103 103 105 115 115 116 117 117 120 120 123 126 131 131 136 137 142 144 151 152 161 161 162 167 169 169 169 173 177 178 184 188...
output:
36 367 321 211 653 192 379 219 135 498 358 628 311 304 624 131 531 140 39 581 254 74 72 240 281 18 294 295 430 546 143 397 97 449 492 352 191 149 183 280 354 382 229 504 274 428 553 297 13 413 388 63 596 390 552 302 260 460 391 283 199 290 76 451 331 172 190 348 528 664 384 363 488 380 320 534 410 3...
result:
ok a perfect matching
Test #10:
score: 3.0303
Accepted
time: 14ms
memory: 55608kb
input:
20 10000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
7 19 13 10 2 17 1 6 4 18 11 16 5 3 9 20 14 12 15 8
result:
ok a perfect matching
Test #11:
score: 3.0303
Accepted
time: 9ms
memory: 55188kb
input:
2 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:
2 1
result:
ok a perfect matching
Test #12:
score: 3.0303
Accepted
time: 10ms
memory: 55116kb
input:
1 200000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
1
result:
ok a perfect matching
Test #13:
score: 3.0303
Accepted
time: 1086ms
memory: 140992kb
input:
2000000 1 387507 1430778 218094 455064 807442 1582214 917699 1655968 1778462 772123 268962 996042 374054 1403419 1624814 36042 813077 1143919 1473390 817258 501378 1317855 1248063 1909613 1978084 1094998 60629 101651 272496 1610999 1051528 859247 300198 1994497 245332 761294 866191 549873 1162726 40...
output:
387507 1430778 218094 455064 807442 1582214 917699 1655968 1778462 772123 268962 996042 374054 1403419 1624814 36042 813077 1143919 1473390 817258 501378 1317855 1248063 1909613 1978084 1094998 60629 101651 272496 1610999 1051528 859247 300198 1994497 245332 761294 866191 549873 1162726 403056 39135...
result:
ok a perfect matching
Test #14:
score: 3.0303
Accepted
time: 2826ms
memory: 99776kb
input:
1000000 2 199363 754950 76613 628921 173375 900947 609231 802901 21413 217216 740983 755278 357523 781326 137929 439975 210831 550908 427758 764273 137762 254720 568822 871564 588642 836016 31686 707140 266427 566788 321499 905137 189618 726558 616699 630104 54080 766176 117957 586699 695703 987876 ...
output:
754950 628921 173375 609231 21413 740983 781326 439975 210831 427758 254720 568822 836016 31686 566788 321499 726558 630104 766176 117957 987876 767528 973796 94468 38853 24371 91765 642217 81723 373256 294316 522841 42217 556529 938408 232092 83664 133826 66848 793115 243028 474009 63141 276683 847...
result:
ok a perfect matching
Test #15:
score: 3.0303
Accepted
time: 1591ms
memory: 76776kb
input:
500000 4 38271 230013 254334 270640 41039 61228 344559 469434 263792 361339 441492 465652 55336 132032 276847 276901 14837 141419 213180 305018 165556 253636 256179 468748 49634 114442 197634 309934 26445 46027 179574 201044 141683 182112 384092 450681 260438 356066 389831 392443 247869 290124 41698...
output:
38271 469434 361339 276901 141419 253636 309934 179574 450681 392443 416988 282497 327576 184280 300340 368334 113288 132522 27368 186917 230363 5997 183404 69164 23604 41512 105301 392417 132676 229004 85438 362915 142095 475283 98672 115932 4677 73284 246279 462026 307776 385474 434103 66371 42026...
result:
ok a perfect matching
Test #16:
score: 3.0303
Accepted
time: 833ms
memory: 70920kb
input:
250000 8 2631 146917 164090 180005 186384 187359 209401 239796 19897 50857 57851 99955 119125 130482 197939 211046 61602 69725 125661 151789 152333 170938 191567 244630 28250 88386 126306 156434 209401 213742 236654 239399 4661 8624 39270 85312 106345 123219 179670 231814 3378 4520 37957 90740 10263...
output:
239796 57851 191567 213742 85312 4520 211319 176653 172972 218765 136406 150215 145720 207444 119397 15069 42219 130873 199939 20209 167194 71443 151593 94040 8468 135795 136575 218178 242568 51269 46295 78047 151800 172239 191397 7397 72715 131104 19573 98035 225314 170609 43497 171095 45787 123872...
result:
ok a perfect matching
Test #17:
score: 3.0303
Accepted
time: 337ms
memory: 65688kb
input:
125000 16 1740 2837 3454 4468 4752 8259 17820 35622 53227 59127 62189 70804 104178 107139 112956 115071 4672 4917 5273 8630 19872 29772 34538 45649 48808 70653 77894 79629 89198 91989 111456 112385 10180 31425 32554 33836 40036 42641 68031 69244 69346 89583 91384 91749 102500 118132 118521 120404 98...
output:
59127 5273 10180 25560 117697 75637 66010 121944 22978 19618 47537 95747 49251 12149 99806 68402 70422 87987 102635 115370 5356 54221 75395 2762 67616 28963 12120 12445 27030 92563 106809 114288 28751 36710 117347 35230 43703 53447 70759 49590 78686 65049 44161 24527 59478 80126 74881 84084 104152 5...
result:
ok a perfect matching
Test #18:
score: 3.0303
Accepted
time: 193ms
memory: 66128kb
input:
62500 32 3835 4069 6664 9493 9882 11044 12096 13503 17277 21165 21387 21724 22795 27921 28532 30505 31535 32452 33959 39348 40644 42723 43420 44352 46706 48636 52153 56846 58062 58696 59340 62159 270 3267 5060 9255 11830 12242 12358 12423 12466 14286 16368 17387 23582 23668 23942 24884 26776 31524 3...
output:
62159 38668 52863 53071 9557 15158 43404 30282 23743 51733 13079 10095 61528 14156 42369 45523 28837 34029 15765 18341 32327 10163 52121 19025 8751 31072 24534 43826 2771 13995 24834 59916 29734 28866 40497 10339 6618 430 27153 874 54083 54818 28231 12700 33603 43237 49688 59710 46384 48245 33553 19...
result:
ok a perfect matching
Test #19:
score: 3.0303
Accepted
time: 72ms
memory: 63028kb
input:
15625 128 51 164 216 257 339 348 735 949 1178 1284 1664 1680 1707 1781 1809 1887 2034 2323 2389 2460 2631 2889 3166 3213 3234 3270 3336 3337 3426 3430 3488 3622 3637 3764 3813 3873 3932 4215 4267 4299 4364 4501 4643 4786 5012 5030 5070 5085 5119 5187 5317 5400 5459 5730 5860 5917 6187 6410 6795 7233...
output:
12050 13224 2556 7219 4602 11165 3005 12250 1756 13914 1609 1010 4144 13906 9267 10500 4057 10570 2218 3492 12867 9305 8438 7758 13120 6265 15323 15560 2054 12644 4750 15460 2391 10552 1240 12375 4000 5510 850 4048 7710 11451 14803 4331 2976 10876 14924 10076 2708 4545 12529 12007 792 6945 1881 1503...
result:
ok a perfect matching
Test #20:
score: 3.0303
Accepted
time: 40ms
memory: 62584kb
input:
1953 1024 1 2 4 6 8 8 9 13 15 15 17 27 31 32 34 35 35 37 38 40 40 42 45 49 50 51 52 57 61 62 63 64 67 69 70 73 79 82 82 83 86 90 91 92 94 100 101 106 106 107 109 111 113 114 116 116 118 120 120 125 127 132 140 147 148 148 153 156 158 159 159 163 165 165 168 169 169 170 170 171 172 173 174 175 176 17...
output:
719 1103 431 187 1155 1416 922 321 692 502 497 706 573 1407 1371 948 533 651 1035 317 454 10 415 6 1148 1214 465 209 1740 1368 1694 422 770 201 1265 1319 123 62 1057 1574 1816 1222 1747 756 736 1746 1202 359 1896 705 1312 1487 320 1239 818 983 1486 935 993 129 538 1856 718 1197 172 1188 241 1674 108...
result:
ok a perfect matching
Test #21:
score: 3.0303
Accepted
time: 26ms
memory: 62648kb
input:
244 8192 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5...
output:
88 124 27 140 83 165 81 64 235 77 75 174 43 69 129 188 87 24 76 23 161 108 145 213 233 148 78 153 73 68 182 110 47 111 56 54 122 1 207 201 172 12 151 240 59 217 113 103 203 91 17 241 52 46 131 96 25 79 65 128 98 2 190 156 175 74 244 229 176 66 130 137 192 63 40 51 143 154 189 112 173 109 149 224 202...
result:
ok a perfect matching
Test #22:
score: 3.0303
Accepted
time: 40ms
memory: 62228kb
input:
30 65536 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
29 4 21 18 30 12 22 2 7 14 28 8 16 5 20 15 17 23 19 3 27 1 10 6 13 9 25 26 11 24
result:
ok a perfect matching
Test #23:
score: 3.0303
Accepted
time: 20ms
memory: 60516kb
input:
3 524288 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
2 1 3
result:
ok a perfect matching
Test #24:
score: 3.0303
Accepted
time: 2169ms
memory: 85012kb
input:
666666 3 3206 64240 199437 251202 414004 479216 133162 349551 525296 267125 278228 385799 255071 266873 648864 203529 309604 516958 227388 593079 647002 98211 414478 512085 200513 287454 395398 81231 139438 488811 180775 408644 487195 74579 149392 515012 466358 589635 620337 159618 186366 345229 255...
output:
199437 414004 349551 385799 255071 309604 227388 512085 287454 139438 487195 149392 589635 159618 455975 390433 444322 232679 491616 135998 554887 578479 425578 647784 265475 381924 239426 31353 351294 201039 99555 360589 157107 227431 11376 262668 466198 450386 477197 293900 578702 501288 449580 15...
result:
ok a perfect matching
Test #25:
score: 3.0303
Accepted
time: 648ms
memory: 65860kb
input:
200000 10 2798 8208 22730 66600 119481 122650 156801 175474 177550 185015 9474 33088 52512 58337 89617 108000 129764 138027 167767 186477 2825 26827 51804 54149 80285 86265 97887 107376 141558 147823 19363 43877 45893 65333 88598 97896 108948 116509 131339 153148 33060 35928 44747 76078 78934 99908 ...
output:
119481 167767 86265 116509 44747 61426 169517 191112 159027 144951 27959 25260 69136 181492 147973 174604 20558 1957 86214 165805 16189 108919 29196 71703 105333 158193 55195 6072 153862 117420 46341 151609 163151 76494 16981 192091 57289 142296 122867 76591 21131 31478 196636 32824 116798 145474 14...
result:
ok a perfect matching
Test #26:
score: 3.0303
Accepted
time: 251ms
memory: 63036kb
input:
100000 20 5397 8196 10191 10507 18634 28459 29340 32559 40283 40598 53734 65521 67349 68029 69345 71483 76269 82047 84895 88672 4462 14803 19562 24889 25953 28548 32601 34192 34507 38342 48801 54116 68838 73926 78615 79627 83981 88503 90442 93297 13394 25531 37640 43005 43893 48131 51275 52948 59539...
output:
40283 54116 52948 77406 88739 66440 89781 62649 23707 64485 79982 24175 32956 70030 83162 52325 21154 55666 41528 38409 51248 61076 53022 56688 11411 85133 43727 86670 63843 67396 79154 67043 17684 31991 71800 80250 25059 10412 44185 19854 72569 64637 56852 76535 46680 30749 15469 61969 38639 13875 ...
result:
ok a perfect matching
Test #27:
score: 3.0303
Accepted
time: 113ms
memory: 63240kb
input:
40000 50 230 2074 4290 4458 5074 6272 7009 8092 9278 10651 11049 11356 11594 11916 14215 14942 15654 17392 18351 19069 19367 19408 20099 20658 20846 22407 23012 23933 25542 25551 25843 25941 27453 27611 28243 29369 30209 30972 31099 33489 33788 34810 34829 34849 36245 36571 37309 37983 38974 39485 1...
output:
4290 26367 24715 14217 35576 6041 37921 14057 19392 33405 11852 10033 8764 29925 39092 13344 35563 28302 15332 16420 33036 19119 24990 13629 5347 15987 30529 2916 4043 6491 3447 546 25340 29399 23922 32397 9887 22523 37633 11154 4032 9393 28832 15710 77 11277 7663 21204 31084 24386 12462 31444 37107...
result:
ok a perfect matching
Test #28:
score: 3.0303
Accepted
time: 83ms
memory: 63068kb
input:
20000 100 346 384 416 439 566 781 899 950 1359 1370 1969 2025 2031 2043 2510 2703 3581 3610 3956 3960 3987 4008 4035 4392 4409 4853 5049 5092 5101 5955 6051 6132 6184 6260 6463 6632 6725 6995 7298 8049 8324 8349 8720 9111 9137 9233 9328 9353 9366 9405 9427 9496 9571 9572 9588 9641 9780 9879 10102 10...
output:
1969 7128 11499 2964 12739 2058 6293 7067 489 18197 530 16340 19920 7499 8013 11364 16139 277 10098 2474 18424 16581 18706 4961 14825 17496 10458 17627 7968 13130 13663 16073 7172 13096 11800 6539 10564 8851 4894 4595 14474 7417 14206 12480 16128 12722 13947 17543 6884 9811 6514 2637 8752 13546 1830...
result:
ok a perfect matching
Test #29:
score: 3.0303
Accepted
time: 54ms
memory: 62768kb
input:
6666 300 16 22 93 102 144 171 192 203 255 266 282 288 363 364 371 371 379 394 409 477 495 497 500 515 654 696 706 718 789 797 810 816 826 826 827 833 844 854 911 913 933 980 982 1006 1055 1078 1087 1116 1130 1139 1178 1245 1266 1367 1386 1447 1463 1468 1472 1489 1492 1495 1502 1513 1519 1526 1527 15...
output:
4189 3452 4615 3138 4756 4920 3623 5005 3009 44 5840 4143 5642 5136 1992 298 2968 274 4516 3553 621 5408 1238 4604 6177 2819 2348 5971 4361 6560 6076 2700 6659 4797 5393 4552 4354 3129 1585 5214 5963 20 4191 4137 185 5802 4297 2355 4102 3080 3981 5236 6599 5551 6476 5129 6591 1479 6034 5280 6408 985...
result:
ok a perfect matching
Test #30:
score: 3.0303
Accepted
time: 40ms
memory: 62560kb
input:
2000 1000 2 3 6 14 17 20 23 23 25 25 28 30 32 32 34 36 38 39 40 41 41 42 42 48 52 52 53 54 54 54 56 60 60 60 61 61 66 67 67 68 70 72 80 83 85 86 87 89 89 90 90 91 92 95 96 98 105 108 109 110 110 113 114 116 118 119 122 124 127 130 131 132 133 134 134 135 143 147 149 152 154 156 161 163 163 165 165 1...
output:
537 1806 748 406 224 1479 1769 325 520 1502 409 658 1603 952 521 1709 1595 395 1561 374 1829 922 802 283 622 307 235 153 367 340 574 1146 1299 1988 85 1114 408 1714 1157 1907 182 1337 699 114 438 1895 280 552 1193 1367 864 49 1448 1717 1218 1334 4 1471 763 1768 1512 1282 1914 737 839 1875 372 198 72...
result:
ok a perfect matching
Test #31:
score: 3.0303
Accepted
time: 23ms
memory: 62304kb
input:
40 50000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
22 18 33 28 11 23 24 32 4 5 21 12 38 1 13 25 26 40 19 7 9 35 39 8 10 30 6 3 34 29 27 20 15 16 2 36 37 17 31 14
result:
ok a perfect matching
Test #32:
score: 3.0303
Accepted
time: 34ms
memory: 59912kb
input:
4 500000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
2 1 3 4
result:
ok a perfect matching
Test #33:
score: 3.0303
Accepted
time: 28ms
memory: 62116kb
input:
1 2000000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:
1
result:
ok a perfect matching