CT62780

The Radiant corridors of Ulrica

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

It is audit day at the moonlit lagoon of Selene. Ulrica spreads the corridors records across the table and picks up a sharp pencil. 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 <= 1807; 0 <= m <= 3614; self-edges make the answer NO.

Example 1:

Input: 975 737 1 2 2 3 1 3 274 823 422 839 196 311 177 693 13 179 396 907 165 655 547 904 498 520 110 571 548 699 113 390 16 37 338 380 375 509 464 855 159 940 587 708 500 623 618 681 652 897 96 899 65 432 333 810 330 947 690 766 596 918 536 580 150 427 192 452 52 683 68 163 36 863 235 470 763 958 224 661 284 941 148 363 199 883 720 895 148 364 731 761 192 964 539 718 226 823 305 809 697 790 66 757 357 513 162 833 309 824 294 781 114 883 69 379 449 943 408 448 108 706 647 886 592 888 33 484 430 924 330 502 336 534 526 898 65 957 553 862 260 521 601 904 458 832 294 327 137 935 256 921 86 433 686 822 204 277 273 781 221 864 69 357 68 502 126 724 32 101 436 783 309 435 277 868 547 860 34 652 36 707 43 193 640 919 12 757 32 171 670 684 259 896 451 618 60 790 295 614 57 950 792 824 150 320 19 161 256 …
Output: NO

Example 2:

Input: 994 3194 1 2 2 3 1 3 302 479 47 743 15 725 782 969 825 904 289 614 107 210 75 873 398 732 12 656 68 882 32 407 552 929 436 627 316 978 548 942 525 555 703 955 520 671 521 855 700 853 650 958 32 324 57 538 496 555 306 517 514 579 670 892 47 757 269 400 724 841 175 791 208 667 876 905 583 745 280 609 28 907 700 953 613 671 31 63 344 425 511 786 800 894 325 440 53 561 721 926 213 299 701 935 465 566 79 453 428 762 168 225 627 774 163 499 549 776 206 498 712 745 161 267 314 671 131 754 192 314 241 905 371 512 517 722 248 863 277 979 184 899 104 601 422 881 284 985 187 729 746 840 411 520 229 598 850 865 283 755 68 627 397 809 818 885 247 576 449 690 497 514 227 695 719 888 168 480 401 685 338 636 17 54 167 511 943 984 839 912 665 726 58 74 775 804 126 326 225 513 379 385 394 695 220 918 387 69…
Output: NO

Example 3:

Input: 1154 2174 80 159 617 950 391 723 482 497 605 1093 521 664 6 836 389 874 247 990 517 1084 914 1127 419 1145 419 572 745 1148 291 797 137 499 704 771 288 702 729 796 234 385 1031 1048 128 1045 734 900 22 602 670 792 377 536 44 1068 89 1050 452 616 463 600 12 517 320 1078 130 306 550 832 246 969 278 1109 470 523 116 1117 20 628 4 355 322 1082 479 783 219 1014 455 885 44 398 813 855 767 1020 144 748 459 985 498 785 176 638 863 1034 656 1101 746 755 734 856 139 660 63 174 69 666 552 784 220 307 9 1063 25 161 141 840 212 469 103 929 79 606 524 713 121 751 805 820 144 1113 254 950 135 428 806 1132 182 539 362 682 590 1028 62 1007 199 350 718 1140 314 577 224 400 651 900 637 846 112 760 74 371 1005 1090 1051 1054 496 637 641 838 851 946 186 768 327 816 640 826 407 1005 788 874 101 829 641 787 47 5…
Output: NO

Constraints:

1 <= n <= 1807; 0 <= m <= 3614; self-edges make the answer NO.

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