CT52318

The Two Guilds of the Faded corridors

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

Morning light hits the pine barrens of Needlepoint as Emeric unrolls the day's manifest of corridors. 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 <= 3728; 0 <= m <= 7456; self-edges make the answer NO.

Example 1:

Input: 571 4603 392 518 156 426 19 134 435 549 365 429 113 144 140 378 267 429 73 251 180 544 311 471 42 520 229 420 114 238 134 417 200 495 145 232 144 328 224 458 377 414 124 245 107 565 260 393 293 558 343 497 141 460 296 387 274 449 238 547 48 118 50 232 231 297 147 169 107 276 88 257 412 414 165 538 247 427 145 564 92 498 2 125 349 448 248 491 91 441 179 482 187 236 11 570 188 482 185 288 469 542 211 282 346 549 4 418 291 314 85 185 298 324 199 369 96 260 146 419 1 348 38 474 276 343 22 154 402 557 4 524 201 297 73 381 115 308 127 323 143 288 118 457 537 571 79 561 203 282 265 521 28 263 196 336 460 561 259 526 395 446 522 567 422 530 61 375 21 281 2 412 81 168 367 536 98 405 194 391 90 118 308 523 59 116 43 549 204 492 368 448 157 473 480 506 478 538 342 569 74 435 298 309 187 290 128 454 7…
Output: NO

Example 2:

Input: 914 3206 313 497 78 483 206 632 246 621 716 743 295 796 325 426 12 778 431 912 10 96 144 812 17 595 157 379 403 872 59 152 24 902 88 406 49 593 93 612 339 820 461 711 94 877 65 543 227 384 617 696 22 47 30 648 473 547 245 696 154 214 117 342 112 841 30 258 586 664 852 859 404 833 244 322 51 81 235 338 124 359 131 528 607 801 256 351 43 726 698 809 34 584 340 843 129 745 154 454 746 860 806 833 279 747 127 445 406 471 594 694 646 851 227 432 368 450 94 432 326 444 544 895 756 839 171 822 186 465 77 83 156 378 234 782 80 826 104 752 299 354 188 300 288 537 688 770 213 884 597 709 509 646 417 809 205 689 132 201 37 105 179 290 391 398 460 474 615 776 121 758 778 884 666 914 103 501 397 458 8 221 369 832 3 351 64 851 549 884 410 481 210 772 551 793 396 827 228 633 774 860 132 576 282 287 223 8…
Output: NO

Example 3:

Input: 613 225 1 2 2 3 1 3 29 519 110 359 82 609 76 326 115 597 125 379 70 132 340 538 165 321 272 579 426 579 97 403 60 84 109 492 238 542 61 396 25 431 342 490 255 514 111 301 201 418 325 444 121 579 90 247 95 438 187 199 72 496 51 365 64 279 485 570 256 311 455 537 366 538 302 555 336 385 111 538 35 181 134 582 493 516 218 274 172 466 8 508 404 519 353 507 200 586 72 128 133 171 21 223 15 497 254 316 310 320 376 604 211 350 442 592 215 595 39 69 100 588 6 599 223 544 194 337 224 323 387 406 41 374 257 501 71 511 117 155 339 603 70 285 49 466 530 575 356 401 161 514 148 390 88 331 29 171 45 476 16 213 268 321 161 259 270 530 266 403 131 549 199 325 213 391 318 525 341 589 516 535 236 305 173 410 422 465 43 232 333 375 12 237 418 538 161 586 271 603 35 57 298 552 152 299 206 515 375 404 241 599 …
Output: NO

Constraints:

1 <= n <= 3728; 0 <= m <= 7456; self-edges make the answer NO.

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