CT53075

The Sable routes of Quartermaster

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Morning light hits the fox den of Rustwood as Quartermaster unrolls the day's manifest of routes. 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 <= 3334; 0 <= m <= 6668; self-edges make the answer NO.

Example 1:

Input: 3014 1332 1559 1857 1525 2779 1155 1181 1655 2527 284 2824 3 1577 2015 2331 159 424 185 1718 447 1228 272 1657 1331 2697 277 2086 2214 2345 2646 2887 66 1172 1533 1995 591 1084 2065 2643 1277 2473 89 2897 2295 2870 692 853 1887 2041 407 2794 1810 2625 448 2263 290 1138 377 2495 1033 1314 2138 2710 1215 2584 1345 2919 58 1411 785 1916 1457 1612 1079 1735 966 2874 1295 2413 537 2454 1132 1340 1542 1954 775 1872 372 2687 900 2815 506 2957 443 608 2505 2520 2525 2961 1031 1652 128 2359 1315 1355 153 2660 405 1623 101 1873 451 2182 2342 2635 646 2553 1181 2622 137 662 8 311 1902 2148 1172 1413 367 2019 35 565 458 1438 25 519 974 1905 621 2784 1002 1281 807 1175 386 429 328 849 960 2522 1567 2929 383 2071 2799 2944 550 816 69 1459 1117 2697 256 651 835 1303 1829 2803 1170 2480 75 1028 520 1418 1…
Output: YES

Example 2:

Input: 1357 1820 277 1227 884 1029 719 1225 319 504 949 1043 915 1151 239 889 290 1327 215 306 85 1168 23 210 719 1117 508 1330 330 672 925 956 250 1032 446 1254 61 560 186 514 1154 1254 1043 1298 13 467 93 390 1195 1324 281 584 15 686 251 545 379 676 328 662 40 173 377 679 671 871 1111 1172 559 752 509 1149 416 515 187 1029 369 1198 132 582 243 782 136 252 1024 1075 406 695 1192 1267 365 910 417 819 150 312 457 696 347 385 21 493 528 984 1084 1163 560 821 88 1137 154 1098 504 802 180 597 174 552 237 1225 1257 1283 1028 1348 207 750 38 60 207 1185 1141 1261 137 1204 128 569 164 1104 472 861 277 1135 250 1207 293 820 202 1215 66 656 49 752 949 1008 203 301 234 1293 333 1323 779 1043 956 1161 11 488 187 1352 347 1107 901 919 196 326 719 777 495 655 550 557 379 602 951 1011 71 241 267 1166 1058 1064…
Output: NO

Example 3:

Input: 1845 5585 1 2 2 3 1 3 669 962 984 1290 542 1657 946 1699 648 1049 136 1661 460 1735 369 406 1474 1579 701 726 1141 1233 121 1126 62 689 854 861 712 1710 955 987 77 1257 1060 1565 124 215 427 568 760 866 58 1219 1195 1842 356 852 602 1505 95 595 139 235 827 1747 1263 1787 143 1781 701 1808 753 1214 268 368 1243 1438 1023 1753 695 945 254 432 209 1101 503 1708 6 383 430 1295 370 1380 593 932 504 1352 696 765 549 731 616 1813 991 1635 487 769 683 1518 474 1685 1025 1628 200 1462 193 734 1017 1412 576 1345 401 1525 815 1456 588 994 35 1694 731 1311 44 1386 200 679 771 1780 305 1117 33 377 1061 1394 117 1588 353 496 1136 1613 1397 1832 942 1047 1185 1712 544 936 101 1205 106 1408 782 1757 743 1335 80 188 1363 1529 1513 1825 579 1176 888 1752 250 1083 614 1471 490 953 103 938 318 1351 9 950 352 …
Output: NO

Constraints:

1 <= n <= 3334; 0 <= m <= 6668; self-edges make the answer NO.

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