CT40339

The Two Guilds Beneath Thimblewick

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the wren hedges of Thimblewick; Cleo weighs the day's corridors manifests and starts the calculations. 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 <= 1463; 0 <= m <= 2926; self-edges make the answer NO.

Example 1:

Input: 956 212 1 2 2 3 1 3 317 584 281 473 43 570 167 544 131 955 41 182 88 266 152 497 590 602 267 813 15 56 56 417 555 820 362 619 210 509 374 527 353 666 694 747 389 600 53 681 247 371 198 837 111 394 209 853 447 760 506 708 44 436 48 708 61 506 513 865 147 722 828 850 398 883 103 874 497 529 159 441 221 897 291 895 111 691 5 450 261 778 172 396 269 423 59 554 102 811 158 955 645 707 706 730 467 899 582 626 465 928 80 308 57 491 271 472 188 270 416 447 889 942 376 780 329 369 471 765 251 777 448 716 248 561 102 526 638 830 39 484 578 668 546 758 205 296 552 650 486 526 229 444 55 506 585 650 78 412 120 814 905 915 704 713 308 480 325 616 466 871 671 875 542 679 42 168 168 191 234 564 154 617 120 722 305 922 87 889 163 381 27 513 531 787 221 802 440 713 645 884 158 695 461 794 656 840 747 912 3…
Output: NO

Example 2:

Input: 1106 2098 1 2 2 3 1 3 376 847 464 842 137 1054 967 1102 422 788 450 839 374 876 516 714 270 741 413 1031 289 602 40 302 718 814 199 596 91 470 327 1077 40 475 1064 1089 533 717 506 845 43 412 70 1090 346 637 81 1024 480 1098 171 349 516 1091 211 713 168 611 497 820 97 673 456 1054 486 594 661 807 1042 1082 349 657 385 915 843 954 52 187 404 528 629 805 141 620 453 1063 439 701 698 803 462 1080 1068 1101 65 1082 713 918 147 192 97 1081 709 1030 852 1077 149 686 268 953 195 392 83 476 65 1094 35 466 15 1030 214 834 79 888 309 436 169 589 69 251 538 712 870 1086 103 567 376 967 252 1086 635 1068 83 553 73 92 512 900 794 966 799 822 51 1061 198 565 522 906 115 1014 265 1005 303 480 462 1033 10 1082 436 565 170 448 852 1105 626 964 488 635 437 929 38 348 351 604 409 623 156 681 260 770 251 653 …
Output: NO

Example 3:

Input: 763 1634 1 2 2 3 1 3 113 490 347 556 176 450 667 709 246 388 306 416 364 460 419 616 56 642 333 424 278 480 139 177 37 40 569 662 303 522 260 713 508 602 71 152 84 701 222 646 184 335 207 617 503 703 28 470 251 286 92 169 402 568 487 499 279 370 212 596 272 439 80 138 331 434 434 680 132 284 624 672 46 708 97 697 130 260 43 711 88 634 534 666 393 507 558 603 30 744 7 664 75 480 252 501 121 550 113 639 237 714 316 686 198 306 403 608 478 654 372 548 519 528 541 730 284 512 663 680 63 206 358 482 69 147 72 146 22 369 136 255 7 107 578 627 139 199 495 665 343 410 464 669 127 238 31 352 357 543 243 583 265 696 279 416 156 375 37 590 64 593 52 467 458 588 187 760 309 424 38 549 247 389 331 447 71 338 234 483 173 363 209 618 80 559 357 702 244 689 383 713 203 358 241 752 576 613 383 710 321 634 …
Output: NO

Constraints:

1 <= n <= 1463; 0 <= m <= 2926; self-edges make the answer NO.

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