CT28909

Kian Counts the lanterns

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Kian inherited the mill at the alabaster quarry of Whitestone along with its curious bookkeeping system for lanterns. Time to make sense of it. 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 <= 648; values are distinct in [1,n].

Example 1:

Input: 473 416 122 266 300 399 257 179 35 377 427 95 401 333 243 192 420 289 389 252 2 318 102 404 61 286 316 471 204 115 371 22 290 146 155 428 21 221 335 32 118 3 55 418 108 390 177 263 343 162 373 391 271 232 159 34 307 400 142 166 396 292 40 5 24 277 147 140 458 183 191 354 7 201 281 189 313 413 468 253 324 280 227 45 255 421 72 126 238 302 450 305 365 331 185 397 81 200 429 92 368 27 111 435 472 406 194 36 190 334 184 392 75 321 79 235 336 172 168 303 196 433 89 206 398 431 309 116 287 169 461 395 456 123 464 241 62 297 375 388 131 224 134 288 153 170 246 37 407 57 171 244 1 148 91 14 188 403 138 441 208 315 294 211 467 299 50 157 367 417 70 26 301 434 278 449 71 69 213 437 460 308 322 205 39 202 165 20 156 203 362 366 411 451 44 386 385 353 226 282 473 364 133 145 314 469 154 214 430 240 13…
Output: 329

Example 2:

Input: 408 177 53 13 110 25 255 111 14 165 102 121 207 73 174 261 149 154 161 234 310 339 133 191 43 276 322 287 391 54 252 87 95 130 163 184 358 364 127 297 112 91 26 175 375 232 311 275 360 331 237 152 221 406 337 29 52 314 298 380 70 160 124 59 216 280 60 93 21 319 394 333 390 131 84 355 388 304 204 81 384 176 167 326 235 49 400 308 3 189 215 343 396 321 92 77 340 387 302 89 212 195 39 349 27 214 196 225 104 241 179 101 199 324 203 136 246 374 183 211 398 305 303 224 348 316 264 79 294 362 291 86 289 156 129 251 83 338 55 8 277 273 272 386 158 403 58 323 113 114 68 17 377 139 67 332 82 401 197 369 240 335 170 168 64 312 16 85 116 378 361 157 42 180 295 328 284 256 243 344 115 153 11 37 404 28 62 365 48 265 279 231 10 247 12 239 72 257 233 30 270 382 47 50 88 367 274 357 381 201 220 290 1 172 1…
Output: 288

Example 3:

Input: 503 454 319 245 115 13 172 70 178 119 25 347 385 163 354 426 341 138 396 49 203 93 124 239 142 310 317 444 292 55 112 131 488 123 246 47 184 374 133 287 375 236 189 440 166 480 291 496 97 501 391 314 459 65 243 33 382 24 383 379 48 485 82 132 106 252 477 91 475 422 285 389 463 309 299 214 271 450 398 88 76 255 200 118 201 227 190 490 499 269 262 28 193 44 284 129 462 136 293 378 492 482 171 388 280 240 451 226 217 334 338 61 474 9 276 358 273 400 471 302 363 328 335 415 223 179 90 98 209 275 449 484 72 427 96 455 448 381 466 313 301 159 164 14 295 73 205 219 41 19 120 167 43 259 495 316 344 336 84 23 149 433 333 304 144 470 211 439 373 355 352 157 213 491 298 176 312 465 194 253 303 318 220 306 233 390 377 350 21 500 327 237 69 20 156 186 64 325 230 183 5 323 445 452 87 281 204 38 424 282 …
Output: 216

Constraints:

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

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