CT57695

The Two Guilds Beneath Serpentis

MediumL6 · Pointer PhantomAcceptance: 0.0%XP: 100

In the jade shrine of Serpentis, Trader the registry keeper keeps careful count of the canals. Schedule the next expedition, every figure matters. 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 <= 759; 0 <= m <= 1518; self-edges make the answer NO.

Example 1:

Input: 310 281 287 310 12 120 3 172 203 289 122 131 53 192 40 292 96 275 84 188 153 183 183 211 29 92 21 24 45 260 130 295 220 305 220 269 13 62 25 294 41 279 16 307 102 280 264 282 76 130 166 243 43 174 132 202 96 104 234 259 113 269 189 270 57 246 118 180 54 250 212 253 113 206 49 234 7 60 25 191 178 233 94 263 139 178 123 280 137 255 20 283 24 299 102 137 12 101 226 280 39 197 72 189 80 215 92 309 149 306 4 227 74 209 1 92 48 270 102 176 106 223 142 254 189 294 28 167 97 169 212 251 149 295 216 227 105 177 89 119 158 201 45 212 224 307 31 54 100 271 237 247 24 223 142 272 158 298 80 165 130 294 173 253 192 267 72 99 26 226 49 139 187 310 117 160 56 137 71 285 256 263 98 239 186 257 81 101 105 121 17 191 72 196 171 288 73 256 183 239 137 237 121 185 3 66 31 236 59 198 140 190 24 232 68 209 155 …
Output: NO

Example 2:

Input: 32 336 7 18 3 14 10 30 1 22 16 17 16 24 16 18 15 17 17 26 5 24 4 24 5 9 13 31 6 13 19 20 10 31 8 13 11 24 20 22 28 32 2 27 9 14 1 29 17 31 8 19 6 24 5 20 15 21 15 20 13 22 20 27 8 21 1 9 15 24 13 23 23 32 19 24 4 25 22 31 2 17 1 17 26 27 3 13 21 26 10 15 11 20 6 16 11 32 3 25 12 29 1 32 18 21 2 6 5 22 6 29 14 26 16 30 17 29 6 12 2 19 6 32 14 31 4 31 23 24 12 27 15 18 12 15 1 2 2 7 17 20 18 26 3 24 23 25 18 19 21 22 3 29 20 26 16 26 28 30 10 32 3 31 4 13 1 15 19 25 12 16 6 14 8 14 19 21 3 32 4 27 14 17 11 31 7 8 13 28 23 27 2 5 9 13 23 30 3 27 7 23 15 19 15 27 7 31 7 25 10 29 20 32 7 28 6 17 9 26 15 23 3 22 4 17 25 26 4 29 29 31 10 28 14 22 5 16 17 28 14 15 2 4 22 26 17 19 9 19 10 18 1 12 19 23 3 9 2 32 21 27 24 32 5 12 6 10 21 32 11 22 4 30 24 31 19 26 13 27 13 25 9 28 3 30 2 13 4 20 22 25…
Output: NO

Example 3:

Input: 216 839 10 59 170 184 52 173 80 168 129 196 57 194 50 181 32 135 190 215 47 140 72 195 152 196 103 114 125 209 131 133 103 148 115 136 116 200 50 117 86 151 90 154 136 182 158 202 73 161 31 91 193 209 35 209 130 209 1 189 24 105 12 205 158 177 149 165 11 185 28 30 9 84 154 191 74 153 14 62 17 89 117 214 62 159 137 146 118 187 110 187 121 182 12 146 85 86 130 131 17 178 41 63 65 209 72 177 38 185 128 203 154 184 189 199 30 193 82 107 62 125 167 184 43 92 146 194 94 193 63 130 160 163 43 178 22 46 69 81 17 18 18 216 30 62 106 133 184 200 182 203 60 126 94 167 78 180 161 206 160 176 25 172 145 205 16 197 139 140 28 210 43 157 96 151 183 191 28 197 130 170 38 180 35 206 95 129 6 25 107 206 37 143 187 196 65 165 66 87 38 197 175 195 62 114 9 65 141 188 56 162 130 167 190 206 72 126 26 196 5 177…
Output: NO

Constraints:

1 <= n <= 759; 0 <= m <= 1518; self-edges make the answer NO.

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