Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
You receive all the numbers from ~1~ to ~n ~ except one. Your task is to find the missing number.
Input
- The first line contains an integer ~ n ~ ~( 2 \leq n \leq 10^6)~.
- The second line contains ~ n - 1 ~ integers. Each number is unique and falls within the range from ~1~ to ~ n ~.
Output
- Print the missing number.
Sample Input
5
1 3 5 2
Sample Output
4
Bình luận