CT57312

Brevin's Timeworn corridors

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Brevin inherited the aviary at the spice bazaar of Saffronia along with its curious bookkeeping system for corridors. Time to make sense of it. 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 <= 909; 0 <= m <= 1818; self-edges make the answer NO.

Example 1:

Input: 724 228 39 234 195 428 369 720 354 599 91 107 360 578 259 650 180 399 273 412 379 383 192 543 183 332 533 570 56 114 344 719 528 604 66 720 3 85 301 551 83 461 334 658 103 720 45 632 229 542 167 189 108 722 322 706 384 455 343 361 373 619 16 645 24 337 486 575 221 391 487 516 187 617 93 654 180 518 8 640 149 657 302 610 613 663 113 555 280 361 151 485 67 112 410 504 360 507 235 470 232 374 31 535 71 530 374 675 441 652 5 56 58 547 494 571 525 617 405 408 80 673 291 712 137 252 29 467 363 433 396 708 258 341 76 561 23 162 48 346 635 653 193 247 419 690 204 576 109 661 68 553 245 300 543 560 278 328 431 463 218 627 87 262 279 495 345 691 211 362 51 99 392 399 407 664 331 381 154 574 459 616 447 623 315 388 289 468 329 600 90 724 224 269 170 315 98 557 383 601 15 556 250 456 123 245 467 644 1…
Output: YES

Example 2:

Input: 613 1085 110 542 64 400 78 181 243 496 431 468 320 504 212 423 157 598 215 461 200 263 249 443 68 130 237 520 587 608 40 193 91 388 145 514 158 492 51 58 517 598 382 588 293 606 181 325 100 579 38 103 59 90 9 203 3 522 182 351 240 578 142 173 166 474 60 164 544 549 80 269 406 601 94 558 439 449 320 562 137 396 35 610 203 391 75 364 39 375 382 556 307 604 243 332 60 162 20 232 520 596 1 484 232 412 326 444 198 359 96 173 520 599 173 236 355 366 467 594 172 490 84 358 63 267 317 431 72 602 262 593 81 551 59 292 108 243 165 429 374 476 52 208 170 509 139 306 380 478 115 517 496 554 104 352 376 604 255 400 240 309 44 484 304 325 392 588 296 415 163 450 3 543 95 542 193 197 481 498 105 122 26 553 57 507 45 511 311 458 24 312 111 418 458 496 49 129 479 572 374 493 447 579 18 546 29 90 218 221 18…
Output: NO

Example 3:

Input: 369 940 124 192 83 155 141 177 97 338 237 356 247 257 246 297 315 356 32 229 83 240 95 160 30 206 16 179 26 172 121 161 46 297 161 242 61 167 74 354 28 294 8 84 42 179 7 278 72 321 46 119 98 355 1 207 99 358 54 182 239 354 187 226 63 298 246 265 219 261 127 301 79 254 137 341 90 250 246 340 241 303 39 105 53 281 199 283 120 152 258 277 151 362 106 309 55 61 60 140 81 368 68 74 358 363 103 269 209 247 9 317 232 304 15 281 103 354 37 181 30 276 85 137 293 314 153 209 121 129 11 210 45 103 165 355 195 197 89 318 9 279 307 353 340 356 2 156 103 307 25 80 42 294 2 314 69 260 254 338 102 185 40 141 223 275 24 213 16 157 66 230 16 280 31 66 14 314 120 185 98 235 54 336 90 315 282 285 31 143 225 290 65 161 193 247 70 160 116 351 39 328 26 305 65 176 110 247 191 247 237 303 22 53 282 319 38 191 206…
Output: NO

Constraints:

1 <= n <= 909; 0 <= m <= 1818; self-edges make the answer NO.

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