CT57778

The Whispering routes of Yusuf

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Deep in the railway depot of Cinderline, Yusuf studies rows of routes entries. One clean number will settle the guild's oldest argument. 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 <= 2895; 0 <= m <= 5790; self-edges make the answer NO.

Example 1:

Input: 869 970 1 2 2 3 1 3 724 775 369 371 607 668 101 324 342 398 9 397 356 653 32 421 329 393 200 638 178 256 96 235 524 628 129 232 214 724 442 491 101 497 514 837 236 335 364 646 612 686 13 828 134 677 640 730 644 764 209 817 324 743 623 717 532 559 248 346 388 656 236 323 53 348 366 612 591 738 54 319 365 420 23 424 127 365 60 215 122 139 200 624 25 136 554 664 111 672 81 318 240 320 264 328 87 771 73 589 245 864 157 301 205 289 666 672 433 746 207 673 441 612 365 645 180 767 462 661 52 324 367 557 5 301 372 387 223 466 340 388 16 797 325 468 480 776 61 223 350 525 52 599 346 463 618 720 8 85 223 807 125 806 478 667 94 520 820 841 605 746 646 649 273 707 104 221 472 718 173 565 207 658 692 713 14 197 23 633 111 324 236 763 98 679 15 527 32 510 701 760 782 821 92 822 267 841 618 763 478 643 5…
Output: NO

Example 2:

Input: 1293 3400 677 723 349 809 43 754 998 1156 227 594 543 679 2 1095 873 1250 11 851 272 1158 357 359 326 745 339 960 109 1036 938 1119 282 997 24 859 420 1089 154 371 25 560 681 1223 300 741 345 1182 99 981 305 1162 14 569 260 500 544 938 568 1255 145 526 1098 1267 82 314 428 430 199 528 1104 1234 369 1105 59 821 777 1121 431 977 438 831 463 842 862 1165 208 657 396 684 427 847 1181 1242 597 784 286 341 93 397 45 269 995 1232 153 634 310 815 546 1203 267 925 200 1099 225 1029 412 593 266 386 633 665 385 461 652 1200 196 297 44 219 469 664 72 820 753 908 138 254 601 1287 120 1139 88 125 59 272 327 749 898 909 592 952 298 1233 53 529 509 1069 3 1283 245 729 38 1174 755 987 138 824 556 1088 859 906 604 1051 124 445 812 881 495 1060 66 525 115 257 852 1049 847 1243 560 657 1019 1166 270 395 212 5…
Output: NO

Example 3:

Input: 1305 2481 189 481 627 685 836 949 19 532 786 1155 802 1118 336 882 1016 1114 23 975 392 896 141 713 46 1054 407 487 954 1279 25 94 434 884 335 573 170 664 79 968 725 1199 213 290 737 1043 161 1128 477 794 597 982 514 789 90 675 927 1214 185 718 573 896 142 890 772 1198 261 1275 141 586 251 344 691 1206 36 983 216 505 150 199 607 1219 442 789 506 1093 882 1136 339 936 599 1228 211 521 855 1298 328 1084 386 587 581 968 482 1027 129 1283 263 540 402 649 739 1265 204 1194 1107 1223 83 706 581 922 662 1109 337 1113 75 611 593 843 828 909 658 1222 478 835 527 809 791 1164 244 545 252 719 906 909 559 699 356 382 972 1193 135 463 122 991 125 161 398 634 411 1029 785 928 189 1103 345 1023 125 451 414 691 804 834 125 304 442 1193 280 1078 346 531 217 502 525 1213 619 852 752 874 738 1084 792 1195 25…
Output: NO

Constraints:

1 <= n <= 2895; 0 <= m <= 5790; self-edges make the answer NO.

Loading...
Test Cases:No test cases
No test cases available.
The Whispering routes of Yusuf - MEDIUM Coding Problem | CodeTikki