Submeter | Todas submissőes | Melhores | Voltar |
Problem hidden
FNDMSNG - Find the missing number |
You are given a permutation (a sequence of N distinct integers between 1 and N) but exactly one integer is missing! Can you find this element?
Input
First line of the standard input contains a single integer N (2 ≤ N ≤ 100)
The second line contains N−1 integers. A permutation with one integer missing. All integers are between 1 and N and all of them are distinct.
Output
Output a single integer – the missing number from the permutation.
Example
Input: 10 10 2 3 1 9 7 8 6 4 Output: 5
Adicionado por: | fuad71 |
Data: | 2022-06-20 |
Tempo limite: | 1s |
Tamanho do fonte: | 50000B |
Linguagem permitida: | Todas exceto: ASM64 CLOJURE ERL FSHARP PERL6 PY_NBC SCALA TCL |
Origem: | https://codeforces.com/group/yg7WhsFsAp/contest/355504/problem/P51 |