CT62949

The Silent Two Guilds

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

It is audit day at the honey farms of Buzzwell. Qadir spreads the routes 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 <= 1204; 0 <= m <= 2408; self-edges make the answer NO.

Example 1:

Input: 250 905 1 2 2 3 1 3 58 247 54 133 139 155 197 236 40 198 16 162 24 124 50 244 195 200 72 160 28 140 79 239 61 167 138 142 148 204 137 223 31 120 25 68 130 224 137 145 108 170 17 99 205 217 64 158 13 137 11 248 137 172 82 133 16 174 149 182 1 30 12 70 2 18 5 215 15 186 89 174 13 232 182 214 59 207 36 149 5 49 9 210 51 196 122 140 23 217 58 171 130 247 126 167 144 180 108 207 60 230 10 58 65 157 6 112 5 227 100 169 32 115 55 186 139 211 174 207 10 174 166 207 111 142 131 168 193 244 46 104 124 179 36 194 52 240 2 141 17 127 101 109 31 114 42 72 112 182 3 69 39 128 142 198 41 155 30 241 220 234 30 217 108 177 43 223 8 183 18 74 140 232 63 118 40 83 108 171 23 236 72 163 204 224 27 192 72 76 148 165 70 127 37 149 34 95 11 28 123 175 108 142 125 174 7 119 87 163 111 149 24 137 96 134 56 232 185…
Output: NO

Example 2:

Input: 1090 1564 801 924 145 716 346 575 342 876 329 805 648 940 253 668 351 834 53 872 370 613 687 999 257 921 595 641 860 915 546 1076 1008 1019 526 829 450 555 76 752 136 307 7 738 418 1077 316 712 128 1047 560 1075 922 960 12 381 420 878 745 879 521 796 269 583 917 1075 151 606 399 979 304 842 64 1007 508 541 258 1074 270 363 510 735 479 905 178 355 463 734 245 775 355 536 187 465 536 813 423 999 438 580 477 892 338 912 70 454 272 931 506 943 181 586 826 898 309 1011 360 808 231 406 367 475 122 156 623 644 13 814 134 827 56 882 217 1054 271 865 347 594 566 880 529 853 728 773 442 752 170 615 933 1015 405 1049 682 731 120 376 660 758 424 499 394 799 439 648 569 1076 316 520 588 696 296 1012 274 692 232 438 816 863 305 1003 341 592 191 974 228 528 161 1024 160 732 265 430 122 1088 415 1084 70 2…
Output: NO

Example 3:

Input: 570 156 542 569 37 469 251 289 270 425 102 217 62 264 72 365 358 527 381 404 371 414 113 268 245 443 170 511 313 405 111 284 220 471 346 375 404 477 40 507 191 566 96 150 71 465 315 422 325 522 235 435 88 546 14 552 18 368 159 373 34 397 428 562 68 519 119 389 140 521 83 570 266 275 111 126 389 522 101 347 478 503 139 392 8 218 67 440 48 240 420 438 1 543 94 495 93 211 306 352 385 504 51 55 51 369 42 280 198 318 125 515 12 470 422 507 172 510 393 423 6 95 292 348 244 305 35 552 378 390 159 346 100 135 10 60 108 369 286 333 164 194 317 369 50 84 66 502 121 545 182 217 38 493 424 558 496 530 12 167 94 504 376 446 7 161 243 375 128 200 129 252 90 241 42 296 6 485 279 403 77 255 108 146 465 513 169 268 149 240 63 519 81 457 212 302 123 281 185 348 35 133 122 201 54 256 372 408 102 258 391 498 …
Output: YES

Constraints:

1 <= n <= 1204; 0 <= m <= 2408; self-edges make the answer NO.

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