CT23512

The ingots at Greystone

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Morning light hits the shale slopes of Greystone as Jessa unrolls the day's manifest of ingots. The tally will decide the next shipment. Task: The array contains n-1 distinct integers chosen from 1..n with exactly one missing. Print the missing integer. Input format: First line: n. Second line: n-1 space-separated distinct integers in [1,n]. Output format: Print the missing integer. Constraints: 2 <= n <= 935; values are distinct in [1,n].

Example 1:

Input: 498 286 453 312 30 202 274 150 298 181 190 199 469 55 258 396 133 98 39 283 331 57 7 347 192 438 353 245 423 95 477 332 173 336 393 89 378 386 215 12 445 176 234 251 221 405 66 321 159 399 470 319 400 479 284 369 290 217 90 420 398 412 329 11 83 281 299 388 271 6 300 481 404 295 482 415 323 434 287 338 84 292 435 47 376 254 364 485 164 53 148 239 236 23 35 372 96 356 161 318 187 247 208 200 140 497 46 387 272 439 363 390 350 416 45 486 183 418 478 142 417 54 110 357 105 473 155 395 472 459 275 242 495 297 170 107 341 32 339 345 381 72 127 34 212 179 446 458 280 3 118 374 37 421 117 56 451 126 174 401 143 94 248 232 16 354 10 123 240 209 455 13 220 449 380 255 409 111 204 324 76 408 436 296 41 139 21 263 340 266 402 50 303 328 358 59 2 269 365 44 480 465 5 370 361 70 189 463 77 273 313 104 …
Output: 108

Example 2:

Input: 352 217 250 331 7 346 170 95 251 254 332 27 325 205 148 129 239 19 234 310 72 47 75 185 85 8 2 258 286 277 92 350 290 191 278 312 213 90 79 78 297 172 323 163 126 104 120 304 269 289 151 190 128 97 24 112 14 200 77 259 20 271 4 150 210 11 225 209 256 102 321 197 240 121 62 282 157 201 177 6 98 188 34 231 153 295 103 17 118 55 136 193 52 342 263 268 344 341 56 49 145 36 159 25 99 180 296 135 348 32 305 124 316 174 320 285 131 122 322 45 86 69 73 108 76 60 101 130 196 272 105 244 329 351 313 71 233 65 298 26 111 138 237 192 48 328 57 334 324 230 309 189 288 291 164 208 333 246 265 338 166 199 167 70 82 300 41 294 203 261 181 106 9 116 5 274 139 30 214 218 267 13 155 284 212 33 311 94 31 187 115 88 343 133 306 266 81 59 347 273 66 248 87 326 352 74 308 119 3 264 301 315 154 221 54 176 23 204 …
Output: 202

Example 3:

Input: 610 577 202 143 345 47 322 120 477 554 361 290 154 597 281 186 386 39 243 409 205 342 422 50 365 400 465 106 141 267 603 161 297 101 173 65 346 26 184 472 306 418 272 401 209 313 319 321 485 231 333 203 330 596 81 398 35 442 67 373 293 589 95 234 550 76 599 301 285 500 224 98 48 441 2 221 251 110 343 563 381 561 595 57 420 75 22 264 242 8 152 460 36 382 133 171 535 602 482 579 468 137 206 474 491 37 575 169 406 388 291 270 311 391 377 85 150 448 49 475 430 248 258 160 32 336 549 155 355 456 298 375 446 217 218 131 544 30 527 15 309 73 200 452 459 571 246 449 350 163 238 214 302 128 219 411 210 27 167 192 567 211 565 180 89 514 188 247 372 25 116 7 417 506 112 583 181 471 124 586 1 458 253 187 570 140 496 374 499 545 380 424 516 384 68 240 366 262 564 97 71 304 305 443 29 548 328 486 318 46…
Output: 387

Constraints:

2 <= n <= 935; values are distinct in [1,n].

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