CT43709

Crystal bridges Two Guilds

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

It is audit day at the wren hedges of Thimblewick. Yami spreads the bridges records across the table and picks up a sharp pencil. 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 <= 2233; 0 <= m <= 4466; self-edges make the answer NO.

Example 1:

Input: 243 4267 89 129 41 72 24 51 153 161 197 229 111 159 2 215 165 218 170 206 169 223 27 215 4 68 112 125 87 116 10 231 30 103 79 223 58 114 79 209 33 34 117 228 70 194 141 148 2 59 38 221 67 176 38 239 95 183 109 190 60 83 121 160 70 137 8 38 51 237 115 118 31 48 55 62 38 138 23 173 148 212 86 95 26 68 13 112 181 240 64 220 127 176 44 224 16 166 109 128 79 230 99 116 37 98 103 188 117 236 6 226 40 120 18 29 5 149 200 207 178 228 44 163 1 13 148 149 213 240 4 237 70 156 94 132 32 107 2 146 153 168 114 181 30 85 66 204 222 234 15 131 35 102 63 232 156 240 101 159 191 214 92 212 106 229 124 176 10 229 19 243 104 106 102 176 7 29 63 205 77 79 84 206 36 214 104 192 32 97 109 229 170 237 148 185 157 177 154 231 86 136 35 180 25 123 124 157 86 157 11 173 118 186 70 241 123 205 125 221 11 17 19 227 4…
Output: NO

Example 2:

Input: 754 966 1 2 2 3 1 3 84 466 226 262 311 553 371 488 273 539 450 656 101 596 315 491 744 754 363 590 484 599 510 614 153 505 392 548 273 559 413 564 65 603 529 728 21 580 121 200 205 557 283 446 302 459 185 334 532 629 12 151 344 736 361 390 53 367 349 553 552 576 14 51 448 549 371 740 389 664 167 593 361 447 238 516 111 520 391 482 505 700 579 645 20 600 52 245 110 338 234 426 41 186 302 356 198 279 89 255 4 486 530 633 583 604 374 598 41 97 53 284 89 193 473 744 207 373 686 745 134 313 272 451 445 746 401 448 37 92 393 628 52 718 39 84 132 462 11 374 103 574 25 136 487 594 10 112 309 733 149 618 98 606 66 486 178 707 193 394 312 695 230 607 78 551 84 159 345 550 23 430 452 619 155 610 261 593 238 330 66 68 592 695 32 381 1 143 404 434 582 682 159 243 33 311 404 441 15 366 167 570 354 453 7…
Output: NO

Example 3:

Input: 432 4276 48 352 101 421 175 275 185 371 297 395 21 235 31 302 56 133 132 361 206 390 73 318 14 365 190 292 189 274 156 314 337 408 117 193 32 353 23 128 43 385 320 426 16 138 84 347 77 234 184 406 26 29 29 128 116 220 211 263 109 237 69 432 84 340 116 325 106 154 36 237 54 316 307 348 10 126 263 344 364 413 306 360 199 392 64 359 106 335 63 389 202 416 144 368 58 306 64 270 242 398 33 315 186 333 35 102 21 113 56 318 200 310 61 132 310 354 276 326 121 391 78 343 88 257 11 399 91 176 115 220 29 112 118 310 37 167 3 381 54 254 67 388 124 355 198 224 119 364 364 423 118 208 92 145 84 95 334 427 224 388 143 155 337 362 142 241 116 150 184 252 243 263 303 305 97 110 40 262 81 237 74 282 355 365 31 186 164 427 291 339 44 390 71 427 112 115 200 281 158 235 158 259 280 353 61 373 405 432 274 297 8…
Output: NO

Constraints:

1 <= n <= 2233; 0 <= m <= 4466; self-edges make the answer NO.

Loading...
Test Cases:No test cases
No test cases available.
Crystal bridges Two Guilds - MEDIUM Coding Problem | CodeTikki