CT60201

The Two Guilds at Lodebarrow

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Legend says the vault under the silver mines of Lodebarrow opens only for a perfect tally of routes. Indu means to find out. 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 <= 1473; 0 <= m <= 2946; self-edges make the answer NO.

Example 1:

Input: 495 1572 161 462 206 209 249 252 142 267 85 196 160 289 451 476 10 207 281 351 190 331 303 413 374 375 329 453 20 422 206 362 242 330 169 477 340 447 274 341 257 349 301 308 69 70 205 298 249 448 105 106 228 472 238 267 230 231 74 401 366 394 42 362 98 161 95 245 43 156 37 396 25 260 200 245 4 388 220 302 248 312 202 293 87 165 11 379 92 217 230 266 325 362 17 492 9 67 144 354 71 119 7 484 104 419 59 259 128 321 16 75 167 217 353 473 110 400 140 162 256 336 226 478 186 362 13 409 158 356 402 464 156 319 5 411 257 302 37 363 388 404 169 217 18 95 16 353 40 97 7 348 9 289 151 293 214 470 151 333 36 455 393 431 93 265 54 490 35 422 43 58 77 429 107 438 151 242 215 290 14 352 227 336 232 367 51 91 359 477 217 328 248 324 249 471 69 293 249 354 122 288 162 356 130 241 142 162 361 364 13 132 93 …
Output: NO

Example 2:

Input: 465 2844 1 2 2 3 1 3 105 272 102 203 283 414 169 290 114 291 83 262 125 413 410 424 393 427 22 370 114 326 134 394 199 463 357 426 12 61 442 463 197 275 311 314 212 446 223 262 35 358 36 247 36 39 98 119 15 225 282 289 10 364 204 328 243 277 307 449 117 318 259 355 157 218 308 437 154 187 56 84 220 368 409 421 126 155 338 463 71 92 71 234 33 440 254 372 378 456 157 186 109 330 213 370 25 79 72 343 50 382 8 223 214 239 354 433 79 237 79 311 199 346 70 422 45 283 124 270 70 390 128 149 20 421 74 176 87 123 215 255 280 347 273 296 197 403 316 427 256 364 282 306 244 440 61 250 150 248 27 450 207 421 41 386 178 427 14 372 203 366 327 349 117 432 17 380 116 297 5 398 88 125 249 317 65 304 75 241 381 402 42 161 249 277 272 335 379 452 256 320 263 352 10 32 335 381 56 296 146 328 206 212 125 138 …
Output: NO

Example 3:

Input: 250 2170 19 92 68 114 117 246 93 199 12 167 107 244 76 101 18 33 72 123 133 149 93 136 112 149 42 86 94 112 97 159 182 237 22 107 139 177 88 171 76 229 158 245 141 151 1 239 8 31 126 161 63 233 129 192 55 191 121 211 20 47 69 200 131 202 54 87 85 102 58 222 46 91 75 203 13 75 38 99 167 195 73 86 26 223 23 93 45 90 106 152 196 242 43 213 46 217 62 199 2 183 32 231 73 191 69 143 8 234 71 227 168 173 146 152 38 141 170 230 67 214 19 94 185 227 38 76 34 147 54 184 48 55 49 185 169 175 99 165 90 114 139 207 51 178 214 241 188 231 108 135 198 231 199 218 181 229 73 200 10 70 10 26 35 69 36 189 115 234 76 127 9 116 7 129 14 26 26 48 84 242 181 200 96 211 35 101 36 70 138 193 127 194 93 159 40 144 131 143 101 111 144 243 61 193 176 214 55 147 170 225 119 165 50 210 8 184 17 20 82 186 191 226 155 2…
Output: NO

Constraints:

1 <= n <= 1473; 0 <= m <= 2946; self-edges make the answer NO.

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