CT65153

Rune's Sable Ledger

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

Rune runs the observatory at the ferry landing of Crosswater. Today the books show a list of tunnels, and the numbers must be worked out before sundown. 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 <= 767; 0 <= m <= 1534; self-edges make the answer NO.

Example 1:

Input: 458 873 1 2 2 3 1 3 271 431 378 442 248 309 409 447 62 155 1 71 265 322 195 370 21 89 138 348 142 215 278 301 34 457 225 234 423 433 190 458 397 442 131 301 133 240 306 447 4 45 15 44 36 274 87 129 312 329 280 419 83 285 171 302 85 417 11 26 281 291 141 361 126 215 99 334 132 425 16 81 100 122 90 222 379 390 39 415 177 190 94 397 169 218 180 449 133 266 237 252 137 283 126 309 196 362 214 441 215 279 52 373 87 256 76 271 172 191 279 363 100 353 79 428 173 194 251 324 224 429 149 176 187 405 39 287 89 294 33 431 354 432 72 96 184 208 34 102 43 165 32 152 157 305 274 379 36 60 213 384 48 443 164 216 227 334 318 454 249 429 91 102 81 211 74 182 159 404 123 201 175 189 74 377 180 338 2 371 90 221 90 295 231 293 78 370 190 450 90 157 136 282 222 353 70 325 9 235 339 389 224 260 312 321 402 408 …
Output: NO

Example 2:

Input: 520 214 57 455 50 300 146 385 107 251 191 206 399 449 382 391 44 59 75 283 60 351 12 45 87 94 296 461 71 317 131 411 136 413 384 441 344 402 61 338 346 468 260 495 218 520 247 458 300 417 237 418 198 423 248 254 375 397 282 492 265 421 64 496 186 459 111 296 49 309 19 304 337 400 190 388 181 210 75 455 152 471 242 263 83 414 310 360 71 74 177 182 8 250 324 499 305 429 9 28 112 309 81 333 125 441 288 412 8 227 95 394 61 197 15 18 479 507 327 337 240 411 185 325 114 395 283 288 331 340 98 432 424 503 39 213 179 200 54 334 431 506 76 145 198 396 49 81 281 462 70 310 145 437 86 239 383 412 262 492 114 162 388 503 10 466 17 501 97 494 68 257 286 385 275 305 453 510 10 250 121 130 185 279 106 377 58 428 155 470 280 499 3 38 115 292 147 223 432 439 131 314 364 422 23 350 229 349 331 431 154 167 3…
Output: YES

Example 3:

Input: 447 1515 1 2 2 3 1 3 33 408 79 341 18 35 312 398 162 292 185 371 18 238 163 370 114 116 26 186 192 297 37 98 309 371 288 375 308 407 87 373 128 207 120 434 272 321 390 406 340 402 282 427 197 253 36 52 17 297 255 440 26 177 78 205 113 120 72 319 123 407 220 238 101 273 206 276 112 334 22 33 60 204 118 162 51 61 124 292 141 190 132 441 157 195 212 332 240 287 89 151 245 338 129 351 18 278 72 384 383 409 121 136 268 417 23 201 50 254 102 238 33 357 154 281 120 339 36 329 9 223 100 272 322 361 67 227 114 210 275 341 84 325 139 298 86 128 186 207 198 390 93 133 26 307 207 390 270 349 302 351 118 201 75 230 24 51 36 92 221 279 14 419 95 395 117 393 48 253 22 441 410 445 285 440 92 428 77 258 263 411 200 428 60 421 181 272 127 161 255 405 313 327 64 293 19 279 152 435 218 367 104 329 239 409 216…
Output: NO

Constraints:

1 <= n <= 767; 0 <= m <= 1534; self-edges make the answer NO.

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