CT61701

Trader and the Crystal corridors

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Trader the assayer watches over the cork grove of Barkhaven's stores of corridors. A careful computation stands between order and chaos. 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 <= 1828; 0 <= m <= 3656; self-edges make the answer NO.

Example 1:

Input: 596 1783 1 2 2 3 1 3 448 521 310 359 223 500 143 174 79 129 523 551 222 418 205 381 287 442 105 503 103 515 137 388 16 438 269 333 23 393 122 556 139 419 67 282 28 491 2 585 370 582 429 572 62 144 186 339 107 284 271 561 89 447 255 366 294 524 245 330 206 286 385 426 286 423 394 489 334 567 364 560 344 395 116 509 186 325 144 324 87 549 47 580 91 228 103 589 150 336 189 516 1 561 77 251 294 410 24 159 156 594 264 339 63 529 291 461 85 119 366 593 563 575 378 492 79 126 517 587 168 447 220 447 296 497 240 355 414 469 74 306 266 596 203 235 167 240 135 393 452 568 222 447 395 510 136 554 31 160 72 571 101 158 552 558 25 518 5 570 36 565 207 543 10 160 143 592 132 514 47 256 17 50 204 316 55 356 293 331 462 582 18 344 67 154 313 585 232 301 125 253 312 479 127 366 13 525 511 531 86 159 487 54…
Output: NO

Example 2:

Input: 801 607 175 736 211 796 371 390 44 487 113 471 303 571 440 545 54 172 195 259 274 643 694 710 318 404 162 683 243 793 266 748 63 801 268 398 499 646 126 626 551 696 192 556 26 500 40 380 148 689 65 117 355 492 215 734 695 748 430 760 393 533 207 322 696 744 174 677 184 792 611 764 474 668 25 720 64 706 137 299 119 718 343 615 90 492 313 689 251 720 304 507 261 348 578 678 183 279 220 550 430 708 227 465 213 296 432 603 15 203 155 488 246 706 303 425 148 554 239 580 293 384 449 499 35 487 113 421 138 673 493 784 114 726 541 697 441 711 49 378 151 224 620 783 253 631 229 715 320 650 500 537 410 666 183 581 215 522 129 767 271 338 500 554 202 446 146 621 434 446 652 726 273 593 432 681 608 763 705 725 170 780 9 118 477 718 205 307 32 406 229 749 117 480 418 676 31 127 108 353 554 559 211 398 …
Output: NO

Example 3:

Input: 251 332 68 126 108 139 80 83 111 166 31 98 34 221 155 221 89 248 66 241 10 160 15 211 53 115 128 129 64 231 201 247 65 70 92 162 2 36 181 241 8 178 82 214 77 126 208 233 130 229 83 232 24 168 17 96 72 101 10 71 57 95 58 135 35 208 75 87 13 228 99 194 9 72 20 133 111 159 18 121 84 130 137 217 142 199 111 247 38 175 3 104 2 50 7 142 59 60 36 177 43 247 69 231 147 161 3 55 208 221 92 191 65 209 50 182 129 228 150 175 46 160 65 174 18 91 32 56 172 232 38 43 42 75 43 147 205 241 17 61 51 238 18 115 132 134 112 157 26 128 103 172 178 223 3 131 25 79 123 194 9 232 201 230 29 67 83 203 39 72 45 163 63 182 121 192 6 90 32 225 36 105 83 170 20 211 85 160 215 222 208 248 46 139 64 203 105 107 45 98 10 49 133 147 65 100 19 136 6 62 88 174 118 136 41 135 35 89 145 210 107 205 60 195 82 201 171 202 3 16…
Output: NO

Constraints:

1 <= n <= 1828; 0 <= m <= 3656; self-edges make the answer NO.

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