CT22062

Curator's Missing Mark Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Every season at the canyon post of Redrock, someone must settle a dispute between crews. This year the task falls to Curator, armed only with the stamps register. 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 <= 320; values are distinct in [1,n].

Example 1:

Input: 297 245 235 143 277 78 145 23 229 203 160 288 42 49 295 217 251 272 66 133 32 152 92 244 8 9 150 184 275 164 259 213 53 175 153 205 264 97 62 222 30 103 157 147 293 111 278 45 26 39 266 176 171 88 132 50 226 173 20 283 130 128 135 249 85 6 5 297 250 11 284 189 61 64 163 182 210 155 148 86 70 121 280 200 126 144 54 202 219 231 41 254 38 52 170 248 279 156 127 257 74 174 282 99 72 270 47 237 255 17 165 71 220 68 214 167 232 125 260 36 107 141 195 93 10 46 69 185 131 243 261 191 115 240 102 37 228 101 140 263 84 58 113 31 114 123 162 87 223 2 227 292 209 118 241 291 238 124 116 215 149 22 247 136 211 14 233 236 224 108 268 239 192 252 154 40 294 55 13 83 290 110 63 151 289 208 104 198 4 142 246 67 96 77 273 35 196 271 286 183 158 57 94 56 267 262 234 159 296 204 112 168 109 82 18 139 216 242 …
Output: 90

Example 2:

Input: 272 199 50 250 122 107 78 104 221 172 209 262 230 66 31 243 214 145 90 65 113 38 129 246 39 270 67 244 114 155 193 33 74 257 93 160 131 192 186 266 105 197 271 159 115 143 92 138 22 135 134 251 86 15 237 97 253 112 77 173 7 63 198 124 236 117 181 47 108 150 184 168 42 20 53 170 28 223 267 45 8 258 263 69 234 149 19 127 130 12 238 247 121 5 14 225 110 260 1 224 48 21 169 252 269 95 179 35 136 99 151 26 25 91 140 206 142 182 41 101 54 200 147 240 229 30 88 261 2 100 49 137 57 167 249 62 81 222 272 9 40 213 256 71 176 119 153 195 226 58 248 203 76 96 220 232 207 82 23 18 189 218 196 211 239 68 116 73 231 156 61 59 80 55 185 34 217 265 165 139 106 157 118 216 255 245 132 109 13 51 11 10 123 125 242 187 191 29 84 46 144 24 128 146 264 102 37 141 79 44 175 126 89 6 148 202 219 85 98 164 161 235 …
Output: 43

Example 3:

Input: 307 171 127 299 140 190 86 250 79 34 274 162 150 279 178 246 13 228 93 292 133 282 19 106 141 181 291 182 188 222 180 187 302 287 268 25 192 16 105 143 126 70 269 20 256 64 235 234 255 277 276 80 230 103 10 43 58 82 51 183 218 109 253 91 261 202 138 87 199 152 48 207 211 17 281 53 61 263 142 107 144 131 174 225 280 94 300 206 295 36 298 173 39 203 136 46 24 156 243 57 244 163 73 5 233 170 113 65 47 209 236 155 132 151 242 196 49 117 284 245 161 29 78 194 191 110 304 229 123 7 84 71 55 172 265 116 3 134 11 204 125 18 99 100 232 272 22 68 63 273 69 239 119 259 278 108 62 220 44 90 249 1 198 307 149 153 176 286 23 165 88 290 251 252 139 168 283 130 45 31 32 275 271 205 4 293 305 111 254 52 231 122 9 50 184 306 297 238 147 96 67 294 241 179 26 120 41 54 247 289 219 14 104 213 260 72 2 223 124 …
Output: 166

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Curator's Missing Mark Ledger - EASY Coding Problem | CodeTikki