2252.Missing Number

通过数:34提交数:73学校:南京大学保研机试真题 题目列表 标签
题目描述 Given a positive integer $n$ ($n \leq 40$), pick $n-1$ numbers randomly from $1$ to $n$ and concatenate them in random order as a string $s$, which means there is a missing number between $1$ and $n$. Can you find the missing number? (Notice that in some cases the answer will not be unique, and in these cases you only need to find one valid answer.) 输入格式 The input consists of two lines: 1. The first line contains the integer $n$. 2. The second line contains the string $s$ formed by concatenating $n-1$ numbers. 输出格式 Output the missing number. 输入样例 20 81971112205101569183132414117 输出样例 16
C
补全
点击调试按钮即可调试代码。

点击提交按钮即可提交代码。