CT52197

Sage's Copper Ledger

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

The council of the shale slopes of Greystone pays by the answer, and Sage intends to earn it. First: the full register of canals. 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 <= 3030; 0 <= m <= 6060; self-edges make the answer NO.

Example 1:

Input: 333 4607 32 251 34 118 101 297 48 168 207 319 202 267 53 82 23 142 103 293 63 189 9 51 6 21 5 127 9 189 55 227 250 319 25 76 103 173 23 234 2 215 123 300 71 305 76 269 173 202 22 262 100 235 167 313 30 133 119 221 122 242 275 309 73 294 18 75 185 268 46 140 89 331 25 324 38 107 184 192 50 113 160 253 80 224 97 102 85 233 210 243 152 261 134 171 156 225 88 157 100 226 241 276 190 298 46 308 49 103 40 113 62 99 209 267 73 160 55 179 140 321 138 240 126 230 131 146 232 329 6 73 4 163 51 94 89 168 2 284 74 300 157 183 87 288 103 332 84 240 14 246 306 322 23 173 5 43 180 199 61 91 279 287 182 271 6 321 38 78 139 306 86 171 56 222 82 192 149 255 178 213 100 221 228 296 214 269 56 152 12 151 29 163 12 164 145 280 193 213 229 285 24 220 131 211 46 49 26 307 179 330 218 246 19 55 178 325 84 256 127…
Output: NO

Example 2:

Input: 1331 5191 1 2 2 3 1 3 820 1120 6 503 719 1321 798 1258 353 649 277 1117 827 1084 1084 1200 116 970 263 490 207 1118 57 141 830 1006 21 338 953 1122 679 1113 421 641 537 750 889 1262 87 483 44 998 307 528 146 690 3 789 57 1274 1174 1293 132 392 424 968 117 1025 260 683 89 639 228 965 155 1068 783 1210 786 1007 632 1167 721 977 609 752 597 1307 915 1185 529 550 1209 1261 368 1262 398 1015 333 976 470 661 80 879 515 908 395 487 394 1275 213 1039 159 511 804 807 218 1186 412 1302 321 378 405 557 241 705 118 677 231 667 1034 1110 76 674 172 1046 109 1052 293 801 511 1031 327 609 404 1276 682 1223 425 822 160 1272 701 996 231 771 925 1018 231 651 76 1253 351 529 1018 1115 111 177 377 988 212 466 337 431 897 1272 974 1258 475 981 800 1129 12 133 904 975 275 811 691 1168 537 1060 1102 1268 264 113…
Output: NO

Example 3:

Input: 1430 2920 462 995 56 219 427 503 1265 1382 33 910 103 1402 787 831 807 823 18 984 879 1147 330 658 1127 1173 234 281 216 353 1047 1407 848 965 379 890 817 1228 259 1054 41 112 378 1226 1221 1329 483 1214 309 328 781 1428 383 684 889 974 510 588 226 373 933 1326 23 495 574 1134 408 489 150 978 70 1081 816 1037 25 788 199 734 308 1382 915 1360 878 1030 220 456 960 1113 4 875 1015 1297 824 1026 191 950 775 810 638 1247 318 819 85 1429 339 789 106 190 372 682 522 1356 900 926 253 1122 363 1115 528 724 513 1089 74 199 146 797 1235 1363 407 1035 335 1261 498 860 719 1222 845 1341 6 1269 430 957 298 503 571 709 152 1358 747 1067 576 764 776 783 82 1337 70 1345 601 1215 81 145 489 746 968 1315 1017 1346 200 494 644 1329 894 1312 683 1165 865 1200 390 455 71 1348 498 955 486 631 680 993 428 671 706…
Output: NO

Constraints:

1 <= n <= 3030; 0 <= m <= 6060; self-edges make the answer NO.

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