CT61605

Quinn's Wayward Ledger

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

The harbor bell rings at the cinnabar mines of Vermilion; Quinn weighs the day's corridors 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 <= 1240; 0 <= m <= 2480; self-edges make the answer NO.

Example 1:

Input: 1117 936 706 1117 443 866 1010 1109 366 595 359 824 203 807 827 909 950 1075 955 1040 99 291 228 396 753 1057 365 466 180 802 38 569 561 1093 574 1116 80 974 186 545 181 902 720 973 993 1025 24 633 307 487 34 513 483 707 261 499 22 131 7 715 21 658 16 267 152 1105 544 649 73 289 926 1073 50 568 28 67 240 433 86 798 353 559 70 753 87 393 280 720 520 541 778 946 40 234 324 725 677 918 40 777 365 754 331 790 28 415 906 1031 291 694 580 1059 109 931 341 507 474 1031 125 569 227 577 43 209 544 1059 133 874 155 295 254 894 417 529 283 635 149 582 243 378 86 1098 39 407 251 754 139 362 287 651 82 717 18 769 122 723 503 944 195 200 286 375 501 580 198 811 231 785 143 463 539 833 315 402 95 643 93 490 857 966 365 825 3 96 181 203 294 1010 238 785 487 596 457 635 521 1011 212 1090 149 797 713 884 13…
Output: NO

Example 2:

Input: 320 678 34 217 307 308 109 278 117 240 154 253 13 97 229 270 240 266 6 84 104 215 179 193 80 221 60 67 164 179 7 314 29 185 103 315 81 318 299 307 54 232 83 255 230 234 108 210 25 106 221 300 3 246 94 305 32 233 76 300 109 212 159 265 131 231 13 83 70 139 80 94 115 135 215 262 108 272 120 204 67 206 102 267 184 241 89 121 187 301 163 175 49 59 32 82 252 277 200 299 62 91 91 266 147 229 65 270 16 104 106 277 105 250 181 253 40 260 56 301 81 238 259 316 97 308 174 256 45 77 4 155 19 245 202 266 114 233 128 190 139 283 157 281 67 175 89 108 213 272 44 279 19 55 106 224 142 261 63 99 24 241 245 253 130 231 1 42 212 216 174 184 173 311 152 290 107 187 230 293 224 271 36 98 134 162 37 125 24 88 85 320 100 175 115 253 89 287 75 313 155 287 52 63 58 143 209 293 179 275 17 292 77 144 134 149 48 229…
Output: NO

Example 3:

Input: 224 696 64 97 75 198 59 112 157 164 10 63 22 202 11 155 59 157 72 112 147 166 66 177 88 151 159 170 124 127 141 161 52 106 71 163 74 102 1 192 151 167 38 67 21 102 148 189 23 180 78 172 5 151 93 185 17 156 112 147 205 212 180 190 21 215 1 14 77 94 39 165 119 169 9 188 29 150 169 199 133 222 169 170 115 159 66 84 8 136 19 79 131 167 29 171 6 62 152 166 20 172 33 58 63 135 26 142 79 135 162 215 8 16 150 217 4 122 11 33 74 145 2 110 118 143 48 218 27 95 85 172 171 191 144 176 92 127 125 140 171 183 48 93 10 31 20 146 39 168 51 175 101 123 32 140 175 177 68 206 28 117 52 91 45 198 24 108 118 172 105 173 66 219 60 66 215 221 130 219 74 187 120 210 51 170 80 201 80 94 63 65 60 222 9 196 59 100 14 146 132 165 200 222 125 191 129 216 19 28 26 104 66 174 59 168 87 99 149 160 110 159 84 189 9 87 63 …
Output: NO

Constraints:

1 <= n <= 1240; 0 <= m <= 2480; self-edges make the answer NO.

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