CT63205

The tunnels at Whitesnow

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Every season at the tundra station of Whitesnow, someone must recover the missing manifest. This year the task falls to Zane, armed only with the tunnels register. 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 <= 2126; 0 <= m <= 4252; self-edges make the answer NO.

Example 1:

Input: 158 1105 12 151 7 56 85 128 44 93 88 122 93 124 66 142 49 61 97 101 7 22 66 131 22 24 79 119 41 43 33 128 11 158 68 103 15 156 16 124 110 150 41 119 110 129 55 121 25 121 27 34 33 131 1 132 2 62 39 118 16 35 11 66 19 126 107 145 21 83 96 139 81 137 56 75 59 86 50 93 53 157 93 118 6 78 55 70 59 68 38 152 84 101 48 73 70 78 5 106 51 73 101 113 65 155 66 122 15 37 47 150 55 122 47 145 59 76 26 81 7 35 13 134 79 115 52 141 10 83 18 87 94 134 99 111 26 120 71 87 22 53 70 77 11 144 51 156 62 65 28 118 27 59 77 114 51 133 83 93 48 82 43 52 3 28 98 155 13 34 63 67 60 81 62 122 54 149 113 153 121 133 14 47 52 81 112 113 20 139 1 51 60 87 49 137 65 110 38 154 16 80 102 134 11 116 85 134 81 158 13 70 24 80 87 97 41 83 33 126 81 111 142 152 15 142 83 104 42 79 8 31 10 142 105 140 31 82 88 115 74 155 4…
Output: NO

Example 2:

Input: 1286 3497 309 322 577 1091 146 423 176 491 1047 1122 486 929 70 561 231 1104 112 976 221 824 89 228 273 632 666 875 353 1029 23 913 532 1256 240 307 61 128 303 670 310 1198 430 729 266 583 44 1254 695 1259 460 709 108 757 52 521 575 1056 172 400 80 232 122 1068 547 885 711 1271 191 1058 240 496 885 1057 649 1028 771 1257 62 1035 200 1223 680 1092 1072 1160 596 911 890 906 484 1161 318 726 14 602 265 606 485 1072 125 743 227 316 591 681 471 1140 962 1117 841 997 85 1217 644 1200 263 1014 883 1284 364 703 99 560 406 760 1036 1095 718 1273 217 1027 321 794 436 856 547 1245 128 1059 592 998 684 960 394 1193 121 600 1050 1127 346 894 1157 1188 405 1103 14 1167 343 610 365 1109 551 621 359 794 394 879 329 953 394 453 413 1268 373 897 83 587 716 854 1017 1019 157 655 134 731 497 1279 642 1008 602…
Output: NO

Example 3:

Input: 630 3689 498 501 298 375 199 587 113 251 254 366 405 454 139 159 450 597 142 288 256 511 290 501 575 607 280 630 140 337 576 590 18 236 22 370 219 392 73 235 246 395 460 582 79 380 28 615 147 228 180 300 260 294 133 226 552 625 145 285 540 598 2 24 182 337 42 113 206 477 198 619 533 561 107 529 111 408 444 613 50 477 218 574 584 587 172 264 286 409 19 484 296 336 147 605 65 325 286 306 504 566 324 471 154 582 399 433 412 571 40 390 98 323 580 628 196 537 288 624 106 138 220 298 27 357 125 433 149 244 39 198 59 466 287 305 258 529 99 406 308 575 69 157 302 610 148 609 246 590 67 306 338 428 394 553 140 462 20 47 113 537 176 382 422 447 141 534 442 557 205 241 207 336 400 454 252 481 91 377 250 345 309 505 186 215 122 271 159 170 293 514 83 560 58 148 230 436 333 615 384 521 417 485 33 478 1…
Output: NO

Constraints:

1 <= n <= 2126; 0 <= m <= 4252; self-edges make the answer NO.

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