CT37817

The Two Guilds of the Shimmering tunnels

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The harbor bell rings at the zephyr cliffs of Galeholm; Lara weighs the day's tunnels manifests and starts the calculations. 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 <= 2088; 0 <= m <= 4176; self-edges make the answer NO.

Example 1:

Input: 1002 1580 453 754 344 596 40 338 544 788 556 1002 651 905 217 347 199 760 560 934 310 705 214 985 772 963 182 236 9 414 268 670 393 976 107 195 216 295 560 582 309 639 242 267 30 935 514 800 261 450 9 837 72 333 164 835 221 363 315 660 154 700 106 183 255 396 666 701 245 674 265 655 78 785 287 423 370 891 505 898 352 758 100 202 117 207 217 852 628 850 244 592 23 898 313 650 107 830 712 726 732 910 338 669 83 154 2 205 253 686 413 468 3 607 562 903 151 407 539 838 353 449 364 508 287 508 763 883 522 751 652 910 2 44 43 625 716 764 514 960 819 901 169 314 1 906 421 902 6 713 492 851 61 67 434 711 33 195 697 974 302 730 128 429 233 983 298 463 745 859 256 261 357 939 348 654 243 995 79 656 214 397 13 295 194 310 407 926 171 798 346 690 114 683 226 958 272 928 340 440 348 866 232 241 357 760 …
Output: NO

Example 2:

Input: 660 2738 74 286 525 633 153 317 377 493 88 205 72 100 42 217 392 538 81 350 7 368 426 550 85 261 7 66 24 492 497 592 35 39 577 579 169 327 368 397 158 302 279 291 79 444 86 173 503 546 87 117 268 271 269 610 238 343 35 513 50 294 160 457 483 546 285 395 145 343 157 565 565 607 276 435 267 418 374 596 211 380 21 406 154 426 126 644 25 207 42 412 86 567 344 348 206 211 151 481 176 562 121 654 134 201 127 566 16 549 31 254 55 569 248 372 204 267 400 455 155 528 486 489 260 517 218 594 191 611 306 425 73 463 340 371 403 425 116 450 204 627 380 536 289 336 525 602 374 423 107 207 53 368 65 223 62 447 72 505 281 286 483 639 8 626 375 549 203 482 423 598 12 658 62 267 180 421 54 410 97 361 197 462 516 556 141 416 49 657 113 582 431 511 37 380 88 100 349 505 297 438 62 286 539 596 286 497 155 619 …
Output: NO

Example 3:

Input: 259 3501 1 2 2 3 1 3 70 164 56 99 79 122 8 80 30 207 211 236 106 194 41 172 56 199 13 74 56 66 17 95 148 240 144 164 13 146 56 153 77 258 31 189 7 15 12 71 142 199 16 191 58 236 153 187 164 179 36 129 210 212 111 167 37 213 140 208 5 85 9 143 54 62 9 97 117 234 123 167 155 227 13 77 95 188 181 210 158 243 175 196 91 152 106 159 37 108 133 182 92 138 35 214 2 254 40 236 137 242 30 141 52 227 44 90 82 208 7 237 129 259 63 129 51 233 189 255 18 100 111 220 42 58 1 251 165 255 58 159 99 108 58 68 43 217 219 254 80 248 113 176 50 172 58 157 101 173 223 236 54 197 22 116 36 195 14 19 18 26 172 236 90 156 193 240 61 223 161 209 170 217 91 231 4 110 84 118 55 83 48 102 15 259 60 164 158 169 72 127 191 235 143 214 223 234 45 147 196 254 13 93 36 137 25 87 82 103 31 175 20 173 84 92 54 82 120 174 65…
Output: NO

Constraints:

1 <= n <= 2088; 0 <= m <= 4176; self-edges make the answer NO.

Loading...
Test Cases:No test cases
No test cases available.
The Two Guilds of the Shimmering tunnels - MEDIUM Coding Problem | CodeTikki