CT58533

The Two Guilds Beneath Glowfen

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

The harbor bell rings at the lantern district of Glowfen; Emeric weighs the day's routes manifests and starts the calculations. 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 <= 841; 0 <= m <= 1682; self-edges make the answer NO.

Example 1:

Input: 265 1178 1 2 2 3 1 3 11 69 47 57 92 242 52 154 124 170 16 181 96 223 112 144 84 205 78 101 62 74 90 150 150 211 130 161 36 209 27 223 122 178 68 195 205 247 236 256 28 254 159 227 23 153 217 219 50 154 201 253 40 261 146 209 48 88 75 136 88 196 56 179 141 212 83 204 153 231 34 79 25 169 155 264 196 247 9 248 46 211 51 201 50 110 13 259 15 102 84 211 75 157 49 235 179 239 148 158 103 152 64 212 94 183 151 205 89 101 144 199 12 75 52 224 70 73 2 47 110 221 132 217 50 152 35 116 16 129 132 183 12 20 22 215 49 118 122 192 121 168 95 240 7 197 69 122 112 117 140 158 130 190 134 256 90 124 76 153 60 236 146 263 91 140 174 226 42 54 98 169 15 85 177 211 77 259 9 50 59 194 55 162 38 235 2 66 144 149 34 56 142 153 185 211 56 78 57 233 40 202 7 115 105 214 81 107 31 197 242 257 8 213 82 144 172 212 …
Output: NO

Example 2:

Input: 280 559 1 2 2 3 1 3 88 248 7 192 253 271 3 107 197 240 86 186 76 93 39 103 93 126 9 120 22 60 82 261 29 160 52 237 67 76 17 92 170 255 149 213 151 170 212 240 98 124 145 175 5 13 35 201 156 161 186 254 96 249 227 262 9 228 7 89 79 180 170 228 130 186 150 242 95 180 79 222 115 251 51 86 201 264 48 153 67 187 109 266 98 169 141 204 187 235 116 220 250 280 128 180 43 264 183 194 73 200 64 220 10 222 95 197 136 179 50 82 79 133 34 143 20 166 40 179 193 271 20 111 76 177 191 271 2 21 4 14 100 187 47 250 32 266 7 181 165 178 20 168 93 206 113 119 134 261 1 36 45 233 1 170 53 189 39 273 205 262 70 173 37 231 89 97 2 92 173 233 22 247 175 269 185 210 155 268 121 255 16 119 40 86 4 260 49 154 125 236 66 98 109 217 115 116 48 194 31 138 65 192 16 169 13 169 127 237 5 186 119 194 75 211 162 280 52 89…
Output: NO

Example 3:

Input: 838 491 1 2 2 3 1 3 561 671 749 786 91 357 70 710 496 746 278 396 9 319 239 556 136 522 206 362 106 294 62 144 13 773 319 442 286 741 5 829 672 726 234 387 133 272 247 666 116 636 411 606 589 626 371 722 383 556 14 805 159 547 137 497 15 213 153 708 204 500 324 622 117 427 621 643 76 476 220 724 286 353 46 434 118 822 279 826 539 615 35 276 520 609 43 168 720 803 356 828 339 825 276 643 436 542 278 426 88 695 128 795 94 435 23 731 622 810 218 255 188 324 358 546 150 689 186 436 302 696 352 590 561 737 20 343 245 375 75 326 319 581 223 656 300 389 331 615 325 801 609 639 141 820 416 585 612 707 21 790 314 350 325 738 89 558 9 740 175 638 372 604 138 735 270 494 220 656 648 779 156 245 62 712 325 496 57 308 332 708 745 814 96 103 361 784 91 664 658 665 450 539 322 505 52 624 487 660 323 602 …
Output: NO

Constraints:

1 <= n <= 841; 0 <= m <= 1682; self-edges make the answer NO.

Loading...
Test Cases:No test cases
No test cases available.
The Two Guilds Beneath Glowfen - MEDIUM Coding Problem | CodeTikki