Pro.ID1536 TitlePiggy banks Title链接http://10.20.2.8/oj/exercise/problem?problem_id=1536 AC15 Submit24 Ratio62.50% 时间&空间限制描述Byteazar the Dragon has N piggy banks. Each piggy bank can either be opened with its corresponding key or smashed. Byteazar has put the keys in some of the piggy banks - he remembers which key has been placed in which piggy bank. Byteazar intends to buy a car and needs to gain access to all of the piggy banks. However, he wants to destroy as few of them as possible. Help Byteazar to determine how many piggy banks have to be smashed. Write a programme which:
输入注意:输入包含多个测试数据。 The first line of the standard input contains a single integer N (1 ≤ N ≤ 输出Description Byteazar the Dragon has N piggy banks. Each piggy bank can either be opened with its corresponding key or smashed. Byteazar has put the keys in some of the piggy banks - he remembers which key has been placed in which piggy bank. Byteazar intends to buy a car and needs to gain access to all of the piggy banks. However, he wants to destroy as few of them as possible. Help Byteazar to determine how many piggy banks have to be smashed. Write a programme which:
Input 注意:输入包含多个测试数据。 The first line of the standard input contains a single integer N (1 ≤ N ≤ Output The first and only line of the standard output should contain a single integer -- the minimal number of piggy banks to be smashed in order to gain access to all of the piggy banks. Sample Input 4 Sample Output 2 Hint In the foregoing example piggy banks 1 and 4 have to be smashed. Source 样例输入4 样例输出2 提示In the foregoing example piggy banks 1 and 4 have to be smashed. |