CSES - Missing Number
Xem dạng PDF
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ớ:
512M
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 are given all numbers between ~1,2,\ldots,n~ except one. Your task is to find the missing number.
Input
The first input line contains an integer ~n~.
The second line contains ~n-1~ numbers. Each number is distinct and between ~1~ and ~n~ (inclusive).
Output
- Print the missing number.
Constraints
- ~2 \le n \le 2 \cdot 10^5~
Example Input
5
2 3 1 5
Example Output
4
Bình luận