CT57239

The Rushing Falls Two Guilds

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

It is audit day at the salmon ladder of Rushing Falls. Iker spreads the canals 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 <= 2549; 0 <= m <= 5098; self-edges make the answer NO.

Example 1:

Input: 495 3301 232 351 204 436 72 445 170 482 117 169 236 476 151 417 191 331 17 134 235 384 161 388 427 468 462 478 315 412 181 424 69 154 174 401 308 421 52 432 108 452 214 378 241 402 36 70 359 494 22 479 39 63 119 471 93 256 196 452 130 434 75 482 247 276 19 305 201 263 417 442 146 300 262 328 110 123 359 493 54 192 100 151 176 214 87 88 65 114 139 472 220 242 440 487 34 329 327 433 292 412 41 81 13 320 113 262 304 482 163 375 57 363 285 369 318 337 307 346 68 400 46 266 273 405 21 340 173 446 14 449 61 336 40 131 312 366 408 455 73 205 374 471 86 487 1 425 261 307 10 307 268 407 183 487 337 444 304 325 358 456 260 317 428 463 52 257 74 292 223 402 48 100 224 372 18 368 63 402 228 413 116 149 61 101 246 297 277 283 237 313 26 392 110 219 17 324 241 464 63 111 198 256 24 367 123 205 21 391 12…
Output: NO

Example 2:

Input: 1902 4758 1 2 2 3 1 3 629 1674 210 960 156 645 28 1468 714 1820 1371 1878 106 710 1238 1275 1370 1381 428 573 826 1414 586 1407 484 525 64 119 500 606 561 1246 1 189 961 1445 73 1692 1587 1761 1357 1749 55 737 899 1370 21 889 245 672 8 434 1145 1519 435 1030 96 166 465 1721 720 849 1057 1748 326 905 260 379 709 1788 1154 1672 1140 1801 434 1110 669 1261 1541 1648 662 833 134 394 26 263 367 1634 522 1325 499 787 565 1550 528 1248 581 1799 1069 1771 1085 1882 322 1774 970 1828 388 1198 959 1611 783 1789 173 1596 285 1080 147 1257 30 218 1134 1366 1666 1819 564 1325 32 1816 953 1296 666 834 584 1670 569 1045 619 956 935 1405 1173 1578 1279 1535 1402 1782 1066 1131 84 275 724 1609 615 954 796 1793 426 1543 305 371 53 658 302 1302 43 1557 861 930 714 730 669 1816 756 837 153 1355 314 1236 870 1…
Output: NO

Example 3:

Input: 942 4407 471 719 553 569 299 488 576 755 338 743 132 313 360 849 6 339 363 902 439 760 290 736 95 312 718 772 264 656 385 626 173 259 191 404 44 546 758 827 61 910 183 636 460 892 122 273 622 786 431 893 79 87 119 781 114 353 548 628 375 792 219 321 167 699 242 925 22 267 70 487 244 390 315 641 687 920 463 860 99 874 189 556 102 593 63 186 894 911 201 718 680 884 622 698 47 890 541 571 234 778 502 828 199 511 44 897 240 349 666 937 384 398 258 348 403 820 49 567 154 359 593 605 484 538 222 331 278 906 448 935 114 939 406 470 204 848 234 911 724 906 327 494 383 477 64 910 475 487 384 428 438 788 69 823 145 296 27 579 551 665 533 668 105 332 89 351 619 905 23 39 222 411 252 315 686 775 722 799 460 922 405 665 109 221 175 513 63 749 393 483 719 872 591 736 496 654 87 129 316 366 649 828 44 93…
Output: NO

Constraints:

1 <= n <= 2549; 0 <= m <= 5098; self-edges make the answer NO.

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