CT51706

The Obsidian Two Guilds

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the frontier camp of Duskwood. Qadir spreads the bridges 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 <= 3050; 0 <= m <= 6100; self-edges make the answer NO.

Example 1:

Input: 897 5318 1 2 2 3 1 3 404 720 139 415 417 480 620 629 313 565 206 372 294 521 267 353 439 558 461 669 173 629 127 592 145 176 506 539 363 858 83 374 10 559 65 691 112 376 684 707 116 735 286 542 308 523 103 771 820 876 27 478 505 638 107 481 494 731 32 557 743 781 118 432 292 775 114 592 7 254 143 820 350 358 280 283 486 797 154 396 253 572 351 388 82 435 705 856 214 822 189 353 418 572 281 756 177 679 115 754 132 708 284 749 327 507 52 360 117 566 158 469 369 407 31 149 1 421 519 605 163 355 423 508 448 725 365 870 61 793 46 369 391 456 89 509 402 520 254 423 598 600 431 466 346 639 341 626 404 626 373 420 184 850 501 538 687 883 247 328 706 842 23 615 116 691 402 713 210 828 26 94 277 705 679 746 112 258 265 409 239 857 341 548 450 762 52 493 1 102 580 764 314 857 280 425 535 620 631 733 …
Output: NO

Example 2:

Input: 1904 5325 556 1439 268 1458 1172 1208 359 771 1242 1755 27 758 125 525 304 1497 785 1218 459 1603 1208 1754 1737 1886 610 1020 911 1430 844 1089 1437 1541 743 1511 1154 1648 803 1427 15 1621 24 202 51 1423 6 221 373 1177 609 1715 458 1715 926 1742 902 1802 416 476 954 1644 159 1784 167 1557 733 1497 121 389 367 1273 399 655 25 1022 146 1832 587 1305 574 1337 18 1189 979 1242 300 1618 49 1154 1195 1510 91 165 208 345 1460 1807 470 1204 598 1272 512 1261 222 364 277 643 557 729 236 551 1683 1899 795 1355 1222 1862 484 1684 772 1723 534 845 524 1059 748 1785 706 1161 1409 1565 1305 1408 1033 1414 48 224 793 1886 23 926 695 1392 293 1380 672 1779 316 803 89 585 948 1728 542 1314 1141 1471 692 823 279 1620 393 1246 1046 1095 1176 1243 484 1300 375 427 460 1588 472 1866 255 1147 704 733 1075 157…
Output: NO

Example 3:

Input: 2792 5387 1793 2115 932 967 488 1983 69 1525 1142 1169 835 2562 1174 1187 918 1064 785 2042 1723 2007 66 376 90 2460 733 1106 1171 2440 520 2619 337 1397 202 2072 35 116 848 2170 1469 1627 1495 2611 180 1712 677 849 798 2556 157 2168 2398 2766 947 1725 827 1362 186 198 651 2301 1147 2376 147 706 235 2096 1886 2289 1183 1424 534 769 1305 1499 1639 2274 418 1798 28 2212 327 2067 1636 2340 915 1983 1100 2469 580 1126 1418 2661 644 1244 772 1790 1855 2098 1964 2544 400 2723 2134 2405 172 1872 26 389 1959 2537 540 660 602 1660 1457 2106 65 1738 1685 1872 2035 2672 127 738 2014 2679 1461 2255 4 2508 667 1596 1343 2544 194 2229 795 2391 487 1285 1342 1349 1646 2708 499 1778 6 2372 1991 2191 1078 1830 285 328 1071 2525 539 1797 995 2347 1604 2358 681 1799 477 1817 137 1115 735 1545 96 1495 1272 19…
Output: NO

Constraints:

1 <= n <= 3050; 0 <= m <= 6100; self-edges make the answer NO.

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