CT57018

The Sleekwater Two Guilds

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Morning light hits the otter slides of Sleekwater as Owen unrolls the day's manifest of tunnels. The tally will decide the next shipment. Task: Print YES if the undirected graph's nodes can be split into two groups with no edge inside a group, otherwise NO. Input format: First line: n and m. Next m lines: u v. Output format: Print YES or NO. Constraints: 1 <= n <= 2842; 0 <= m <= 5684; self-edges make the answer NO.

Example 1:

Input: 811 2792 1 2 2 3 1 3 306 500 255 424 176 178 130 798 235 748 36 466 675 748 513 566 676 716 370 386 142 631 148 222 115 478 611 630 476 709 245 684 153 344 340 416 137 355 417 665 318 394 49 454 361 651 399 751 321 572 165 732 475 535 305 362 128 163 225 739 26 553 399 677 160 327 483 541 428 463 180 747 161 325 351 444 101 372 189 635 216 292 50 783 574 636 46 760 81 402 166 580 159 243 46 621 192 736 181 182 606 771 259 291 66 196 265 509 396 711 461 494 240 773 296 748 19 476 621 785 486 615 469 773 292 526 609 648 158 450 570 706 485 494 214 799 478 711 139 476 327 430 131 601 184 389 95 594 119 152 220 737 21 88 329 747 431 617 746 773 153 220 502 811 594 643 240 570 451 724 42 310 768 769 30 43 691 755 45 181 801 806 137 366 628 653 72 298 304 762 313 610 159 786 147 711 262 568 103 …
Output: NO

Example 2:

Input: 1289 2410 100 446 156 599 69 340 674 723 221 1166 315 1242 1030 1034 64 1257 197 504 182 784 201 593 1087 1109 98 896 376 692 1121 1256 1112 1173 713 1173 797 1174 897 1166 419 607 541 820 21 49 425 874 112 1231 259 1216 266 987 625 889 59 818 89 521 30 485 610 1128 147 241 929 1123 16 556 293 610 408 531 412 548 342 508 689 791 929 939 209 1104 331 426 262 644 389 1036 197 1003 561 798 68 1081 550 1073 179 246 281 868 90 585 88 1247 745 1078 378 1248 717 1242 520 918 677 901 143 481 167 360 953 964 152 788 388 532 178 1083 758 771 326 704 310 1098 144 959 1204 1254 4 932 181 825 10 67 719 1171 756 1088 738 1262 425 982 295 339 1172 1273 1 1016 427 825 166 802 234 609 383 583 467 917 857 986 780 1100 851 944 651 794 592 870 826 1100 712 921 218 991 470 1221 1139 1194 117 948 964 1062 198 1…
Output: NO

Example 3:

Input: 1141 2611 670 830 478 841 13 865 739 781 627 761 260 284 961 964 740 950 160 248 980 1051 131 441 541 726 168 172 47 843 699 901 63 386 625 1092 536 543 344 815 311 478 17 162 835 901 148 1021 377 806 895 981 300 720 768 913 181 935 496 729 744 1138 296 515 11 420 96 597 783 995 207 272 18 296 396 968 4 343 132 302 50 1053 778 856 83 468 77 105 56 290 599 650 351 579 617 932 423 446 151 497 110 274 855 1022 145 538 46 80 76 661 154 522 310 793 181 429 69 963 352 624 587 755 808 835 191 883 129 841 253 335 9 328 142 905 275 379 428 909 316 346 919 962 105 940 56 407 370 817 333 742 931 1141 745 1013 107 1043 655 833 594 618 607 1081 78 516 26 50 182 547 515 760 655 1066 299 678 28 960 514 528 582 827 223 1032 149 240 247 1116 617 655 867 1062 442 676 380 908 175 1136 188 592 172 267 251 109…
Output: NO

Constraints:

1 <= n <= 2842; 0 <= m <= 5684; self-edges make the answer NO.

Loading...
Test Cases:No test cases
No test cases available.