CT45927

The Two Guilds Beneath Needlepoint

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the pine barrens of Needlepoint; Devi weighs the day's tunnels 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 <= 1562; 0 <= m <= 3124; self-edges make the answer NO.

Example 1:

Input: 928 194 1 2 2 3 1 3 86 333 86 637 631 762 398 480 136 366 372 596 151 856 357 371 507 524 57 427 853 872 132 473 106 783 122 670 531 873 171 254 176 508 228 750 502 686 161 236 433 822 426 488 408 674 485 907 111 697 27 384 790 863 498 577 513 555 110 614 142 648 473 724 91 609 220 653 256 387 382 800 64 843 427 630 287 317 641 741 122 207 435 701 203 904 19 333 438 876 221 599 295 625 268 579 468 613 868 914 394 703 472 615 327 538 77 642 701 913 460 790 161 798 91 287 64 764 302 359 42 128 628 639 323 348 100 227 372 392 457 893 343 922 427 634 313 700 369 435 310 773 589 666 118 798 125 731 335 441 271 911 450 704 480 671 609 701 627 631 134 400 110 162 257 341 378 834 718 843 74 666 221 312 123 897 301 526 457 881 82 623 78 307 127 563 132 730 212 698 831 880 443 888 701 806 607 880 32…
Output: NO

Example 2:

Input: 1019 2102 23 79 3 720 17 161 180 835 380 890 422 859 82 289 216 233 429 600 676 915 492 921 717 990 454 683 191 618 216 227 522 730 426 941 746 875 442 502 755 774 112 180 102 589 331 711 314 837 166 955 568 778 436 806 11 501 40 621 737 801 433 993 429 553 65 859 706 841 109 766 140 268 351 759 527 1014 52 505 691 971 235 897 733 772 460 925 177 985 522 844 297 361 451 785 165 725 11 257 673 760 970 982 658 933 538 577 351 367 118 673 866 899 426 437 126 384 702 878 409 807 56 679 350 530 824 843 621 924 540 992 914 977 25 259 573 844 440 678 751 949 768 968 476 755 33 114 327 578 157 445 173 827 563 684 138 619 490 889 248 506 151 172 59 671 449 798 16 453 166 822 211 347 87 841 307 331 914 994 139 963 120 999 210 559 359 699 281 812 438 998 418 810 128 787 130 310 138 157 147 628 131 58…
Output: NO

Example 3:

Input: 1113 1295 1 2 2 3 1 3 518 813 868 963 124 1071 510 531 252 562 490 1086 38 639 157 850 528 663 36 295 502 675 576 743 449 468 519 661 821 872 600 685 393 898 671 1020 45 185 256 812 110 746 610 1033 430 839 642 831 597 948 93 766 12 311 538 637 132 991 419 845 149 323 595 821 186 1048 95 730 1026 1110 145 777 268 960 283 936 864 960 956 1096 28 998 384 676 251 1090 218 1013 53 852 319 916 299 854 32 1097 239 579 798 1079 563 822 391 866 651 799 954 993 183 471 420 817 162 244 383 769 670 926 736 857 829 963 208 246 295 615 145 977 1 464 305 485 17 290 562 912 566 991 639 838 45 1076 1023 1050 55 1062 1030 1074 381 1070 401 1091 459 999 582 592 322 408 449 596 652 1004 111 869 766 1113 39 676 4 953 730 742 207 512 937 1050 457 473 221 595 516 994 953 995 395 882 8 978 42 916 340 1097 287 90…
Output: NO

Constraints:

1 <= n <= 1562; 0 <= m <= 3124; self-edges make the answer NO.

Loading...
Test Cases:No test cases
No test cases available.
The Two Guilds Beneath Needlepoint - MEDIUM Coding Problem | CodeTikki