CT59405

Quade's Bright tunnels

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Morning light hits the poppy fields of Scarlet Plain as Quade unrolls the day's manifest of tunnels. 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 <= 1939; 0 <= m <= 3878; self-edges make the answer NO.

Example 1:

Input: 63 1337 8 49 58 61 7 38 4 57 21 49 29 46 54 55 3 59 52 59 16 56 11 60 12 58 15 36 31 49 8 29 17 22 11 13 16 48 38 45 5 26 28 29 29 45 1 50 16 52 11 54 3 58 5 40 6 27 32 40 1 46 15 34 11 26 29 37 5 52 50 51 26 60 33 62 22 43 39 41 39 61 40 55 14 56 37 59 3 6 8 10 50 62 11 47 17 46 4 32 2 53 57 59 15 63 16 18 8 59 12 32 30 52 2 11 38 48 11 17 21 58 7 31 6 38 7 32 38 44 45 51 14 29 23 29 16 62 11 44 34 59 13 27 47 53 18 55 27 42 11 14 37 48 17 63 10 27 26 34 49 62 20 37 35 62 31 54 29 41 60 63 15 35 8 20 33 60 38 55 21 59 3 60 16 35 20 43 19 56 44 60 12 50 26 56 27 63 7 22 1 62 13 51 19 49 1 56 11 34 34 44 9 54 52 60 10 39 29 55 4 63 27 29 15 22 32 58 36 39 41 55 21 33 23 54 16 53 34 58 28 40 8 62 46 49 32 42 41 57 9 51 10 45 25 39 36 48 9 49 52 63 9 48 12 49 51 55 14 40 2 28 15 19 38 53 45 4…
Output: NO

Example 2:

Input: 1642 2388 878 1124 1276 1346 222 623 85 1039 912 1205 57 744 1463 1555 181 1579 72 1363 776 1194 745 773 342 1136 1043 1511 349 647 804 1537 165 1439 501 1188 1131 1573 1043 1637 1087 1132 295 1088 247 381 821 874 470 1405 405 437 564 866 606 904 1059 1367 865 882 518 743 1240 1312 561 1483 23 418 177 1010 220 813 1503 1622 443 1513 719 976 326 712 235 764 868 1609 338 841 114 1472 528 1472 512 1242 1510 1532 384 1625 21 1538 256 615 433 704 82 989 44 1456 119 1640 1555 1640 354 1213 823 1264 683 928 161 474 88 939 366 1267 519 1006 166 1635 100 1642 803 1218 328 767 237 1356 1139 1582 106 938 1220 1438 661 1580 182 1167 718 1539 537 802 278 494 538 1318 1342 1413 945 1207 459 1487 343 459 80 916 293 1504 711 1010 1252 1489 687 1434 626 811 828 842 102 1253 499 1364 1066 1404 647 698 1329 …
Output: NO

Example 3:

Input: 446 2914 331 345 285 364 35 126 39 414 233 276 143 383 126 169 125 184 351 387 266 324 412 417 6 327 226 387 14 222 106 383 306 329 410 437 335 425 38 347 281 348 177 225 158 312 271 317 123 291 62 265 215 415 54 282 117 201 190 197 49 400 183 208 352 388 2 246 321 404 229 402 165 356 36 62 70 111 9 361 124 206 121 409 132 380 45 392 304 383 316 333 161 399 158 234 89 269 304 371 267 434 324 336 8 312 104 267 25 72 114 234 80 330 6 222 186 233 56 352 28 79 308 359 13 301 2 24 146 219 127 212 79 241 208 324 14 118 41 292 138 147 149 207 183 259 60 428 38 375 39 263 80 268 273 338 51 165 123 155 163 204 263 359 100 295 208 250 359 396 90 412 203 437 34 58 436 442 44 421 183 355 14 115 83 96 129 304 286 337 281 311 168 418 90 209 79 111 133 369 59 330 8 357 167 387 325 394 16 91 5 211 50 208 …
Output: NO

Constraints:

1 <= n <= 1939; 0 <= m <= 3878; self-edges make the answer NO.

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